/* ============================================
   AIPlay — AI Image Lab (International)
   Xingtu / Meitu-style mobile design
   ============================================ */

:root {
  --bg-base: #000000;
  --bg-surface: #0a0a0a;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --bg-input: #1c1c1c;
  --border: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 255, 255, 0.16);

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-muted: rgba(255, 255, 255, 0.35);

  --accent: #9eff00;
  --accent-soft: rgba(158, 255, 0, 0.15);
  --accent-dark: #7acc00;
  --pink: #ff2d78;
  --purple: #9d4edd;
  --cyan: #00d9ff;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 999px;

  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-float: 0 8px 30px rgba(0, 0, 0, 0.5);

  --nav-height: 60px;
  --header-height: 52px;
  --max-width: 480px;

  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.45;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button, input { font-family: inherit; outline: none; border: none; }
button { cursor: pointer; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

#app {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  position: relative;
  background: var(--bg-base);
}

.view {
  animation: viewIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0 16px;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Header ---------- */
.top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 800;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.lang-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.lang-selector select {
  background: transparent;
  color: var(--text-primary);
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 4px;
}

.back-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.back-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--text-primary);
  transition: background 0.2s;
}

.back-btn:active { background: var(--bg-card); }

.back-header h1 {
  font-size: 1.05rem;
  font-weight: 700;
}

/* ---------- Select Photo Button ---------- */
.select-photo-btn {
  position: sticky;
  top: var(--header-height);
  z-index: 40;
  width: 100%;
  padding: 14px 16px;
  margin: 16px 0;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: all 0.2s;
}

.select-photo-btn:active {
  background: var(--bg-card-hover);
  transform: scale(0.99);
}

.select-photo-btn .plus {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-size: 1.2rem;
  font-weight: 800;
}

/* ---------- Category Tabs ---------- */
.category-tabs {
  position: sticky;
  top: var(--header-height);
  z-index: 40;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 12px 0;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar { display: none; }

.tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab.active {
  color: #000;
  background: var(--accent);
  font-weight: 700;
}

.tab:active { opacity: 0.7; }

/* ---------- Section Headers ---------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 12px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
}

.section-more {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ---------- Template Grid ---------- */
.template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.template-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}

.template-card:active { transform: scale(0.97); }

.template-card .thumb {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--bg-card);
}

.template-card .thumb img,
.template-card .thumb .thumb-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.template-card .thumb .use-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
}

.template-card .thumb .hot-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 7px;
  border-radius: var(--radius-full);
  background: var(--accent);
  font-size: 0.6rem;
  font-weight: 800;
  color: #000;
  text-transform: uppercase;
}

.template-card .t-title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.template-card .t-creator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.template-card .t-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
}

.template-card .use-btn {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid var(--border-bright);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: all 0.2s;
}

.template-card .use-btn:active {
  background: var(--bg-card-hover);
}

/* ---------- Horizontal Carousel ---------- */
.carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}

.carousel::-webkit-scrollbar { display: none; }

.carousel-card {
  flex-shrink: 0;
  scroll-snap-align: start;
  width: 120px;
  cursor: pointer;
  transition: transform 0.2s;
}

.carousel-card:active { transform: scale(0.96); }

.carousel-card .c-thumb {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  margin-bottom: 8px;
  background: var(--bg-card);
}

.carousel-card .c-thumb img,
.carousel-card .c-thumb .c-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-card .c-title {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carousel-card .c-subtitle {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- Upload Zone ---------- */
.upload-zone {
  border: 2px dashed var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 48px 20px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  background: var(--bg-card);
  margin: 16px 0;
}

.upload-zone:active { border-color: var(--accent); background: var(--accent-soft); }

.upload-zone .upload-icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-zone .upload-title { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.upload-zone .upload-hint { font-size: 0.78rem; color: var(--text-muted); }

.upload-preview {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 16px 0;
}

.upload-preview img { width: 100%; border-radius: var(--radius-lg); }

.upload-preview .change-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border);
}

/* ---------- Generate View ---------- */
.gen-template-preview {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.gen-preview-thumb {
  width: 72px;
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.gen-preview-thumb .thumb-bg {
  width: 100%;
  height: 100%;
}

.gen-preview-info {
  flex: 1;
  min-width: 0;
}

.gen-preview-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.gen-preview-uses {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.gen-upload-area {
  margin-bottom: 4px;
}

.gen-upload-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
  background: var(--bg-card);
  color: var(--text);
}

.gen-upload-icon { font-size: 2.5rem; }
.gen-upload-text { font-size: 1rem; font-weight: 700; }
.gen-upload-hint { font-size: 0.78rem; color: var(--text-muted); }

/* ---------- Template Detail View ---------- */
.detail-page {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  z-index: 50;
}

.detail-hero {
  position: relative;
  flex: 1.4;
  min-height: 0;
  background: #000;
}

.detail-hero-media {
  width: 100%;
  height: 100%;
}

.detail-hero-media .thumb-bg {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.detail-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 40%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

.detail-back {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  cursor: pointer;
}

.detail-share {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 2;
  cursor: pointer;
}

.detail-body {
  flex: 0 0 auto;
  padding: 24px 20px 16px;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  margin-top: -20px;
  position: relative;
  z-index: 1;
}

.detail-emoji {
  font-size: 2rem;
  margin-bottom: 8px;
}

.detail-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.25;
}

.detail-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.detail-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}

.tag-collection {
  background: var(--accent);
  color: #000;
}

.tag-hash {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.detail-creator-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.detail-creator-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #9d4edd, #ff2d78);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.detail-creator-name {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.detail-uses {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.detail-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.detail-footer {
  flex: 0 0 auto;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.detail-footer .btn {
  width: 100%;
  justify-content: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  transition: all 0.2s;
  width: 100%;
}

.btn:active { transform: scale(0.98); opacity: 0.9; }

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-ghost {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-bright);
  color: var(--text-primary);
}

.btn-lg { padding: 16px 26px; font-size: 1rem; }

.btn:disabled { opacity: 0.45; pointer-events: none; }

/* ---------- Quiz ---------- */
.quiz-progress {
  display: flex;
  gap: 6px;
  margin: 20px 0 16px;
}

.quiz-step {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--border-bright);
  transition: all 0.3s;
}

.quiz-step.active { background: var(--accent); }

.quiz-question {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.25;
}

.quiz-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-option:active { background: var(--bg-card-hover); }

.quiz-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.quiz-option .opt-emoji { font-size: 1.4rem; }
.quiz-option .opt-text { flex: 1; }

/* ---------- Hairstyle Grid ---------- */
.style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.style-item {
  border-radius: var(--radius-md);
  padding: 16px 8px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.style-item:active { background: var(--bg-card-hover); }

.style-item.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.style-item .style-emoji { font-size: 1.8rem; margin-bottom: 4px; }
.style-item .style-name { font-size: 0.7rem; font-weight: 700; }

/* ---------- Loading Screen ---------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.loading-orb {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--cyan), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  position: relative;
  animation: spin 1.8s linear infinite;
}

.loading-orb::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--bg-base);
}

.loading-orb .orb-emoji {
  position: relative;
  z-index: 1;
  font-size: 2.4rem;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.loading-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 6px;
  text-align: center;
}

.loading-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 24px;
}

.loading-progress-bar {
  width: 100%;
  max-width: 280px;
  height: 3px;
  border-radius: 2px;
  background: var(--border-bright);
  overflow: hidden;
}

.loading-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.4s ease;
  width: 0%;
}

/* ---------- Result Card ---------- */
.result-container { padding: 16px 0; }

.result-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 9 / 16;
  max-width: 340px;
  margin: 0 auto;
  box-shadow: var(--shadow-float);
}

.result-card .result-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.result-card .result-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 18px;
}

.result-card .result-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.85;
  text-align: center;
}

.result-card .result-score {
  font-size: 3.6rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.result-card .result-percentile {
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0.9;
  text-align: center;
  margin-top: 6px;
}

.result-card .result-stats {
  display: flex;
  gap: 6px;
  margin: 12px 0;
}

.result-card .stat-pill {
  flex: 1;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  text-align: center;
}

.result-card .stat-pill .stat-val { font-size: 0.85rem; font-weight: 800; }
.result-card .stat-pill .stat-label { font-size: 0.55rem; opacity: 0.65; text-transform: uppercase; }

.result-card .result-roast {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  font-size: 0.8rem;
  line-height: 1.5;
  margin-bottom: 12px;
}

.result-card .watermark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  opacity: 0.55;
}

.result-card .watermark .wm-brand { font-weight: 800; }
.result-card .watermark .wm-cta {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  font-weight: 600;
}

.score-ring {
  width: 130px;
  height: 130px;
  margin: 0 auto 14px;
  position: relative;
}

.score-ring svg { transform: rotate(-90deg); }
.score-ring .ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 8; }
.score-ring .ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.score-ring .ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-ring .ring-text .num { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.score-ring .ring-text .label { font-size: 0.65rem; opacity: 0.6; text-transform: uppercase; }

/* ---------- Share & Unlock ---------- */
.share-bar {
  display: flex;
  gap: 8px;
  margin: 18px 0;
}

.share-btn {
  flex: 1;
  padding: 12px 6px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.share-btn:active { background: var(--bg-card-hover); }
.share-btn .share-icon { font-size: 1.4rem; }

.unlock-cta {
  border-radius: var(--radius-lg);
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin: 16px 0;
  text-align: center;
}

.unlock-cta .unlock-title { font-size: 1rem; font-weight: 800; margin-bottom: 4px; }
.unlock-cta .unlock-desc { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 14px; }
.unlock-cta .unlock-buttons { display: flex; gap: 10px; }
.unlock-cta .unlock-buttons .btn { font-size: 0.8rem; padding: 12px 14px; }

/* ---------- Recommend ---------- */
.recommend-section { margin: 20px 0; }
.recommend-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 0 16px;
}
.recommend-list::-webkit-scrollbar { display: none; }

.recommend-card {
  flex-shrink: 0;
  width: 130px;
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.recommend-card:active { background: var(--bg-card-hover); }
.recommend-card .r-icon { font-size: 1.6rem; margin-bottom: 6px; }
.recommend-card .r-name { font-size: 0.78rem; font-weight: 700; margin-bottom: 2px; }
.recommend-card .r-desc { font-size: 0.62rem; color: var(--text-muted); }

/* ---------- Bottom Nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 20px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s;
  position: relative;
}

.nav-item.active { color: var(--accent); font-weight: 700; }

.nav-item::after {
  content: '';
  position: absolute;
  top: -8px;
  width: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.2s;
}

.nav-item.active::after { width: 20px; }

/* ---------- Toast & Modal ---------- */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid var(--border-bright);
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 200;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.modal {
  width: 100%;
  max-width: 340px;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 26px 22px;
  text-align: center;
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal .modal-icon { font-size: 2.8rem; margin-bottom: 12px; }
.modal .modal-title { font-size: 1.15rem; font-weight: 800; margin-bottom: 8px; }
.modal .modal-desc { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }
.modal .modal-actions { display: flex; flex-direction: column; gap: 10px; }

.ad-modal .ad-timer {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  position: relative;
}

.ad-modal .ad-timer svg { transform: rotate(-90deg); }
.ad-modal .ad-timer .timer-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
}

/* ---------- Confetti ---------- */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 7px;
  height: 12px;
  top: -20px;
  animation: confettiFall 2.8s linear forwards;
}

@keyframes confettiFall {
  to { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ---------- Trending Timeline ---------- */
.trending-view {
  padding: 0;
  min-height: calc(100vh - var(--header-height) - var(--nav-height) - env(safe-area-inset-bottom, 0px));
}

.trending-header {
  padding: 16px 16px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.trending-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.trending-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.region-tabs {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.region-tabs::-webkit-scrollbar { display: none; }

.region-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.region-pill.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 700;
}

.trending-body {
  display: flex;
  height: calc(100vh - var(--header-height) - var(--nav-height) - 130px - env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}

.date-wheel {
  width: 90px;
  flex-shrink: 0;
  position: relative;
  overflow-y: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: y mandatory;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(20,20,20,0.5) 20%, rgba(20,20,20,0.5) 80%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(180deg, transparent 0%, black 20%, black 80%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 20%, black 80%, transparent 100%);
}

.date-wheel::-webkit-scrollbar { display: none; }

.date-wheel-items {
  padding: 50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.date-item {
  scroll-snap-align: center;
}

.date-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.35;
  transform: scale(0.85);
}

.date-item.active {
  opacity: 1;
  transform: scale(1.1);
}

.date-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
  max-width: 70px;
}

.date-item.active .date-label {
  color: var(--text-primary);
}

.date-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.date-dot.active {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.trending-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: none;
}

.trending-content::-webkit-scrollbar { display: none; }

.trending-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
  min-height: 300px;
}

.trending-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  animation: trendIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.trending-card:active {
  transform: scale(0.98);
  border-color: var(--border-bright);
}

@keyframes trendIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

.trend-thumb {
  width: 86px;
  height: 86px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.trend-emoji {
  font-size: 2.4rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.35));
}

.trend-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.tag-hot { background: var(--pink); color: #fff; }
.tag-rising { background: var(--accent); color: #000; }
.tag-new { background: var(--cyan); color: #000; }

.trend-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.trend-title {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trend-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.trend-region {
  display: flex;
  align-items: center;
  gap: 4px;
}

.trend-btn {
  align-self: flex-start;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #000;
  font-size: 0.78rem;
  font-weight: 700;
  border: none;
  transition: transform 0.15s ease;
}

.trend-btn:active { transform: scale(0.95); }

/* ---------- Responsive ---------- */
@media (min-width: 481px) {
  body { background: var(--bg-surface); }
  #app { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}

@media (max-width: 360px) {
  .template-grid { gap: 10px; }
  .template-card .t-title { font-size: 0.8rem; }
  .category-tabs .tab { padding: 7px 12px; font-size: 0.78rem; }
}

/* ---------- Admin Panel ---------- */
.admin-view {
  padding: 0 16px;
}

.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  margin-bottom: 14px;
}

.admin-step-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.admin-step-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.admin-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.admin-upload-zone {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 320px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--border-bright);
  background: var(--bg-input);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.admin-upload-zone:active {
  border-color: var(--accent);
  background: rgba(158, 255, 0, 0.05);
}

.admin-upload-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.admin-upload-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-upload-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.admin-preview-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-upload-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
}

.admin-field {
  margin-bottom: 14px;
}

.admin-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.admin-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s ease;
}

.admin-input:focus {
  border-color: var(--accent);
}

.admin-input::placeholder {
  color: var(--text-muted);
}

select.admin-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffffff55' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.admin-toggle-group {
  display: flex;
  gap: 8px;
}

.admin-toggle {
  flex: 1;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.admin-toggle.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.admin-field-row {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
}

.admin-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Gen Type Selector */
.admin-gen-type-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.admin-gen-type {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.admin-gen-type:active {
  transform: scale(0.96);
}

.admin-gen-type.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.admin-gen-icon {
  font-size: 1.3rem;
}

.admin-gen-label {
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Gen Type badge on template cards */
.gen-type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 3px;
  z-index: 2;
  letter-spacing: 0.02em;
}

.admin-t-gen {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

.admin-check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.admin-template-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-template-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
}

.admin-t-thumb {
  width: 48px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-card);
}

.admin-t-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-t-info {
  flex: 1;
  min-width: 0;
}

.admin-t-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-t-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.admin-t-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.admin-t-edit {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(158, 255, 0, 0.12);
  border: none;
  color: var(--accent);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.admin-t-edit:active {
  background: rgba(158, 255, 0, 0.25);
}

.admin-t-delete {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 45, 120, 0.15);
  border: none;
  color: #ff2d78;
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.admin-t-delete:active {
  background: rgba(255, 45, 120, 0.3);
}

.admin-tip {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(158, 255, 0, 0.06);
  border: 1px solid rgba(158, 255, 0, 0.12);
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---------- Ad Stats ---------- */
.admin-ad-stats-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 20px;
  font-size: 0.85rem;
}

.ad-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.ad-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}

.ad-stat-card.ad-stat-revenue {
  background: rgba(158, 255, 0, 0.08);
  border-color: rgba(158, 255, 0, 0.2);
}

.ad-stat-num {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.ad-stat-card.ad-stat-revenue .ad-stat-num {
  color: #9eff00;
}

.ad-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ad-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-card);
  margin-bottom: 4px;
  font-size: 0.78rem;
}

.ad-stat-row-name {
  font-weight: 600;
  color: var(--text);
}

.ad-stat-row-val {
  color: var(--text-muted);
}

.ad-stat-note {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  opacity: 0.6;
}

/* ---------- Admin Entry (Me page) ---------- */
.admin-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.admin-entry:active {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.admin-entry-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.admin-entry-text {
  flex: 1;
}

.admin-entry-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-entry-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.admin-entry-arrow {
  font-size: 1.4rem;
  color: var(--text-muted);
}

/* ---------- AI Model Selector (Creator) ---------- */
.admin-model-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.admin-model-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.admin-model-card:active { transform: scale(0.97); }

.admin-model-card.active {
  border-color: var(--accent);
  background: rgba(158, 255, 0, 0.08);
}

.admin-model-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.admin-model-name {
  font-size: 0.85rem;
  font-weight: 700;
}

.admin-model-cost {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.admin-model-cost small {
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--text-muted);
}

.admin-model-desc {
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* ---------- Region Chips (Creator) ---------- */
.admin-region-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-region-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-region-chip:active { transform: scale(0.96); }

.admin-region-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Make section "more" buttons feel interactive */
.section-more {
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: var(--radius-full);
  transition: background 0.2s ease;
}

.section-more:active {
  background: var(--bg-card);
}

/* ===== AD FULLSCREEN OVERLAY ===== */
.ad-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.ad-fs-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.ad-fs-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  cursor: pointer;
}

.ad-fs-label {
  position: absolute;
  top: 18px;
  left: 18px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.1);
  padding: 3px 8px;
  border-radius: 4px;
  z-index: 10;
}

.ad-fs-creative {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1a1a2e, #16213e, #0f3460);
}

.ad-fs-placeholder {
  text-align: center;
  padding: 40px;
}

.ad-fs-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.ad-fs-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.ad-fs-desc {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
}

.ad-fs-cta {
  margin-top: 14px;
  display: inline-block;
  padding: 8px 20px;
  border-radius: 22px;
  background: rgba(158,255,0,0.15);
  border: 1px solid rgba(158,255,0,0.4);
  color: #9eff00;
  font-size: 0.8rem;
  font-weight: 600;
}

.ad-fs-bottom {
  padding: 20px 24px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(0,0,0,0.9);
}

.ad-fs-countdown {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-fs-count-num {
  position: absolute;
  font-size: 0.85rem;
  font-weight: 700;
  color: #9eff00;
}

.ad-fs-skip-text {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
}

/* ===== PAYMENT MODAL ===== */
/* ===== PAYMENT FUNNEL V2 ===== */
.pay-modal-v2 {
  max-width: 360px;
  padding: 36px 24px 20px;
  position: relative;
  text-align: center;
  animation: paySlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes paySlideUp {
  from { transform: translateY(30px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.pay-v2-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  line-height: 1;
}

.pay-v2-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.pay-v2-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.pay-v2-price-block {
  margin-bottom: 20px;
  padding: 18px 16px;
  background: var(--accent-soft);
  border-radius: var(--radius-md);
  border: 1px solid rgba(158, 255, 0, 0.2);
}

.pay-v2-price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
}

.pay-v2-original {
  font-size: 1.05rem;
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.pay-v2-price {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.pay-v2-perday {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 500;
}

.pay-v2-benefits {
  text-align: left;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 8px;
}

.pay-v2-benefit {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.pay-v2-check {
  color: var(--accent);
  font-weight: 800;
  flex-shrink: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.pay-v2-social {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.pay-v2-urgency {
  font-size: 0.76rem;
  font-weight: 700;
  color: #ff6b6b;
  margin-bottom: 20px;
}

.pay-v2-cta {
  width: 100%;
  margin-bottom: 10px;
  font-size: 1.02rem;
  font-weight: 800;
  padding: 15px 20px;
}

.pay-v2-cancel-row {
  text-align: center;
}

.pay-v2-cancel {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 8px 16px;
  transition: color 0.2s ease;
}

.pay-v2-cancel:hover {
  color: var(--text-secondary);
}

/* Step-specific accents */
.pay-funnel.pay-step-monthly .pay-v2-price-block {
  background: rgba(158, 255, 0, 0.12);
  border-color: rgba(158, 255, 0, 0.25);
}

.pay-funnel.pay-step-weekly .pay-v2-price-block {
  background: rgba(0, 217, 255, 0.1);
  border-color: rgba(0, 217, 255, 0.2);
}
.pay-funnel.pay-step-weekly .pay-v2-price { color: var(--cyan); }
.pay-funnel.pay-step-weekly .pay-v2-check { color: var(--cyan); }

.pay-funnel.pay-step-daily .pay-v2-price-block {
  background: rgba(255, 149, 0, 0.1);
  border-color: rgba(255, 149, 0, 0.2);
}
.pay-funnel.pay-step-daily .pay-v2-price { color: #ff9500; }
.pay-funnel.pay-step-daily .pay-v2-check { color: #ff9500; }

.pay-funnel.pay-step-single .pay-v2-price-block {
  background: rgba(255, 45, 120, 0.1);
  border-color: rgba(255, 45, 120, 0.2);
}
.pay-funnel.pay-step-single .pay-v2-price { color: var(--pink); }
.pay-funnel.pay-step-single .pay-v2-check { color: var(--pink); }

/* ===== GENERATE WAITING ===== */
.gen-waiting-card {
  text-align: center;
  max-width: 320px;
  width: 100%;
}

.gen-waiting-thumb {
  width: 120px;
  height: 160px;
  border-radius: 16px;
  margin: 0 auto 16px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.15);
}

.gen-waiting-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gen-waiting-thumb > div {
  width: 100%;
  height: 100%;
}

.gen-waiting-emoji {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.gen-waiting-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 20px;
}

.gen-waiting-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 12px;
}

.gen-waiting-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.gen-waiting-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.gen-waiting-social {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  transition: opacity 0.3s ease;
  min-height: 20px;
}

/* ===== RESULT IMAGE WITH LOCK ===== */
.result-image-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  max-width: 220px;
  margin: 16px auto;
  border: 3px solid rgba(255,255,255,0.2);
}

.result-image-wrap img.result-image {
  width: 100%;
  display: block;
}

.result-image-wrap.locked img.result-image {
  filter: blur(3px) brightness(0.7);
}

.result-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.result-lock-icon {
  font-size: 2rem;
}

.result-lock-text {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.8);
  text-align: center;
  padding: 0 12px;
}

.watermark.hidden {
  display: none;
}

/* ===== SHARE BAR PRIMARY ===== */
.share-btn-primary {
  background: var(--accent);
  color: #000;
  flex: 1.5;
}

.share-btn-primary .share-icon {
  background: rgba(0,0,0,0.15);
}

/* ===== UNLOCK CTA UNLOCKED ===== */
.unlock-cta.unlocked {
  text-align: center;
  padding: 16px;
}

.unlock-cta.unlocked .unlock-title {
  color: var(--accent);
  font-size: 1rem;
  font-weight: 600;
}

/* ===== SIMPLE RESULT PAGE (template) ===== */
.result-simple-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
}

.result-simple-img-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  width: 240px;
  max-width: 65vw;
  border: 2px solid rgba(255,255,255,0.1);
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}

.result-simple-img-wrap img.result-simple-img {
  width: 100%;
  display: block;
}

.result-wm {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
}

.result-wm-icon {
  font-size: 0.7rem;
}

.result-wm-text {
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.3px;
}

.result-simple-img-wrap.locked img.result-simple-img {
  filter: blur(2px) brightness(0.75);
}

.result-simple-lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.result-simple-lock-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.result-simple-lock-text {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.85);
  text-align: center;
  padding: 0 10px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.result-simple-wm {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.35);
  padding: 3px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

.save-bar-btn {
  width: 100%;
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #000;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(158,255,0,0.3);
}

.save-bar-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(158,255,0,0.2);
}

.save-bar-btn .save-bar-icon {
  font-size: 1.2rem;
}

.share-row-mini {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  width: 100%;
}

.share-mini-btn {
  flex: 1;
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.share-mini-btn:active {
  background: var(--bg-card-hover);
}

.result-unlocked-tip {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}
