:root {
  --bg: #04070f;
  --panel: rgba(255, 255, 255, 0.055);
  --panel2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --text: #eef4fc;
  --muted: #8ca3c4;
  --accent: #5eb1ff;
  --accent2: #8b5cf6;
  --danger: #ff5d6c;
  --ok: #6fdc8c;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pyidaungsu", "Noto Sans Myanmar", system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- ambient gradient orbs ---- */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; animation: drift 18s ease-in-out infinite alternate; }
.orb.o1 { width: 560px; height: 560px; left: -160px; top: -180px; background: radial-gradient(circle, #1d4ed8 0%, transparent 70%); }
.orb.o2 { width: 640px; height: 640px; right: -200px; top: 8%; background: radial-gradient(circle, #0ea5e9 0%, transparent 70%); opacity: 0.35; animation-delay: -6s; }
.orb.o3 { width: 520px; height: 520px; left: 30%; bottom: -220px; background: radial-gradient(circle, #7c3aed 0%, transparent 70%); opacity: 0.3; animation-delay: -12s; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(60px, 40px) scale(1.12); }
}

/* ---- top bar ---- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px;
  background: rgba(6, 10, 20, 0.55);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff;
  background: linear-gradient(135deg, #5eb1ff, #3b82f6 60%, #8b5cf6);
  box-shadow: 0 6px 24px rgba(94, 177, 255, 0.45), inset 0 1px 0 rgba(255,255,255,0.35);
}
.brand-name {
  font-weight: 800; font-size: 18px; letter-spacing: 0.2px;
  background: linear-gradient(90deg, #fff, #a8d4ff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-sub { font-size: 12px; color: var(--muted); }
.top-actions { display: flex; gap: 10px; align-items: center; }
.lang-toggle {
  display: flex; border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: rgba(255,255,255,0.04); backdrop-filter: blur(12px);
}
.lang-toggle button {
  background: transparent; color: var(--muted); border: 0;
  padding: 8px 14px; cursor: pointer; font-size: 13px; font-family: inherit;
}
.lang-toggle button.active {
  background: linear-gradient(135deg, rgba(94,177,255,0.35), rgba(139,92,246,0.25));
  color: #fff; font-weight: 700;
}

/* ---- buttons ---- */
.btn {
  border: 1px solid var(--border); background: var(--panel2); color: var(--text);
  padding: 10px 18px; border-radius: 12px; cursor: pointer; font-size: 14px;
  font-family: inherit; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform 0.12s, box-shadow 0.25s, border-color 0.2s;
}
.btn:hover { box-shadow: 0 6px 22px rgba(94,177,255,0.22); border-color: rgba(94,177,255,0.45); }
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: linear-gradient(135deg, #5eb1ff, #3b82f6 65%, #7c5cf6);
  border: 1px solid rgba(255,255,255,0.22); color: #fff; font-weight: 700;
  box-shadow: 0 8px 28px rgba(59,130,246,0.45), inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn.primary:hover { box-shadow: 0 10px 34px rgba(59,130,246,0.6); }
.btn.ghost { background: rgba(255,255,255,0.04); }
.btn.big { width: 100%; padding: 15px; font-size: 16px; margin-top: 6px; border-radius: 14px; }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.danger { border-color: rgba(255,93,108,0.5); color: var(--danger); background: rgba(255,93,108,0.08); }
.btn:disabled { opacity: 0.55; cursor: wait; }

/* ---- banners ---- */
.banner {
  margin: 14px 22px 0; padding: 12px 16px; border-radius: 14px;
  background: rgba(245, 197, 66, 0.08); border: 1px solid rgba(245,197,66,0.3); color: #f3d97b;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-size: 14px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.banner.warn { background: rgba(255,93,108,0.08); border-color: rgba(255,93,108,0.3); color: #f5a3a3; }
.hidden { display: none !important; }

/* ---- layout & glass panels ---- */
.layout {
  display: grid; grid-template-columns: 370px 1fr; gap: 20px;
  padding: 20px 22px; max-width: 1520px; margin: 0 auto;
}
.panel {
  background: linear-gradient(165deg, rgba(255,255,255,0.075), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: 20px; padding: 22px;
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.09);
}
.panel h2 {
  margin: 0 0 16px; font-size: 17px; font-weight: 800; letter-spacing: 0.2px;
  background: linear-gradient(90deg, #fff, #9cc8ff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--text); border-radius: 12px; padding: 11px 13px; font-size: 14px;
  font-family: inherit; backdrop-filter: blur(8px);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(94,177,255,0.18);
}
.field select option { background: #0b1220; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---- theme picker ---- */
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-card {
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  cursor: pointer; background: rgba(255,255,255,0.03); padding: 0;
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}
.theme-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.4); }
.theme-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(94,177,255,0.4), 0 8px 24px rgba(94,177,255,0.25);
}
.theme-swatch { height: 54px; position: relative; }
.theme-swatch .dot {
  position: absolute; right: 8px; bottom: 8px; width: 16px; height: 16px; border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.theme-name { font-size: 11px; padding: 7px 8px; color: var(--text); text-align: center; }
.theme-swatch.auto-swatch {
  background: linear-gradient(135deg, #5EB1FF, #8B5CF6, #FF3D5A, #F5C542);
  background-size: 300% 300%;
  animation: autoSwatch 5s ease infinite;
}
@keyframes autoSwatch { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.theme-card.auto .theme-swatch .dot { display: none; }
.theme-card.auto .theme-swatch::after {
  content: "✨"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.design-badge {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid; border-radius: 12px; padding: 10px 14px;
  font-size: 13px; color: var(--text); margin-bottom: 4px;
  animation: badgeIn 0.5s ease;
}
@keyframes badgeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.status { font-size: 13px; color: var(--muted); margin-top: 10px; min-height: 20px; }
.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }

/* ---- preview ---- */
.preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.preview-head h2 { margin: 0; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon { font-size: 52px; margin-bottom: 12px; filter: drop-shadow(0 6px 16px rgba(94,177,255,0.4)); }
.slides { display: flex; flex-direction: column; gap: 20px; }

.slide-card {
  border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1);
  aspect-ratio: 16 / 9; display: flex; flex-direction: column;
  padding: 4.5% 5%; position: relative;
  box-shadow: 0 14px 44px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
}
/* glass sheen over every preview slide */
.slide-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.07), transparent 32%);
}
.slide-card .snum {
  position: absolute; top: 14px; right: 16px; font-size: 12px; font-style: italic; color: #9CA3AF; opacity: 0.9; z-index: 1;
}
.slide-card h3 { margin: 0 0 3%; font-size: clamp(18px, 2.6vw, 32px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.slide-card ul { margin: 0; padding-left: 22px; font-size: clamp(12px, 1.5vw, 17px); line-height: 1.6; }
.slide-card li::marker { font-size: 1.1em; }
.slide-card.title-slide { justify-content: center; }
.slide-card.title-slide h1 {
  margin: 0 0 12px; font-size: clamp(26px, 4vw, 44px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1;
}
.slide-card.title-slide .subtitle { font-size: clamp(16px, 2vw, 24px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.slide-card.title-slide .kicker {
  font-size: 12px; letter-spacing: 4px; font-weight: 700; margin-bottom: 14px;
}
.slide-card.closing { justify-content: center; align-items: center; text-align: center; }
.slide-card.closing h2 { font-size: clamp(24px, 3.6vw, 44px); margin: 0 0 10px; }

/* glass cards inside preview */
.pv-glass {
  background: linear-gradient(165deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 8px 24px rgba(0,0,0,0.3);
}

/* ---- gallery ---- */
.gallery-panel { margin: 0 22px 30px; max-width: 1476px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.deck-card {
  background: linear-gradient(165deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  transition: transform 0.15s, box-shadow 0.2s;
}
.deck-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,0.45); }
.deck-card .t { font-weight: 700; font-size: 15px; }
.deck-card .m { font-size: 12px; color: var(--muted); }
.deck-card .actions { display: flex; gap: 8px; margin-top: 6px; }

/* ---- modal ---- */
.modal {
  position: fixed; inset: 0; background: rgba(2, 5, 12, 0.65);
  display: flex; align-items: center; justify-content: center; z-index: 50;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.modal-card {
  background: linear-gradient(165deg, rgba(30,42,66,0.92), rgba(10,16,30,0.94));
  border: 1px solid rgba(255,255,255,0.14); border-radius: 20px;
  padding: 24px; width: min(480px, 92vw);
  box-shadow: 0 24px 70px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.12);
}
.modal-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.modal-actions.end { justify-content: flex-end; margin-top: 18px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .gallery-panel { margin: 0 12px 24px; }
  .banner { margin: 12px 12px 0; }
  .layout { padding: 14px 12px; }
}

/* ---- generation loading (animated mini-deck + steps) ---- */
.loading-wrap {
  display: flex; flex-direction: column; align-items: center;
  padding: 52px 20px 40px; gap: 20px; text-align: center;
}
.load-deck { position: relative; width: 228px; height: 128px; }
.load-slide {
  position: absolute; inset: 0; border-radius: 14px; overflow: hidden;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.12);
  padding: 18px;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  opacity: 0;
  animation: deckCycle 9s ease-in-out infinite;
}
.load-slide:nth-child(2) { animation-delay: 3s; }
.load-slide:nth-child(3) { animation-delay: 6s; }
@keyframes deckCycle {
  0%   { opacity: 0; transform: translateY(16px) scale(0.93) rotate(-2deg); }
  7%   { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
  30%  { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
  38%, 100% { opacity: 0; transform: translateY(-16px) scale(0.95) rotate(2deg); }
}
.ls-kicker, .ls-title, .ls-line, .ls-cards div, .ls-hero {
  border-radius: 4px;
  background: linear-gradient(100deg, rgba(255,255,255,0.10) 40%, rgba(255,255,255,0.28) 50%, rgba(255,255,255,0.10) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.8s linear infinite;
}
.ls-kicker { width: 26%; height: 8px; }
.ls-title { width: 70%; height: 14px; }
.ls-line { height: 8px; }
.ls-cards { display: flex; gap: 8px; }
.ls-cards div { flex: 1; height: 44px; border-radius: 8px; }
.ls-hero-ring {
  position: absolute; top: 10px; right: 14px; width: 54px; height: 54px; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0.6;
  animation: ringPulse 2.4s ease-in-out infinite;
}
@keyframes ringPulse { 0%,100% { transform: scale(0.92); opacity: 0.4; } 50% { transform: scale(1.06); opacity: 0.8; } }
.ls-hero { width: 58%; height: 18px; margin-top: 18px; }
.loading-title { font-size: 17px; font-weight: 800; letter-spacing: 0.01em; }
.loading-dots::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots {
  0% { content: ""; } 25% { content: "."; }
  50% { content: ".."; } 75% { content: "..."; }
}
.load-bar {
  width: min(320px, 80%); height: 8px; border-radius: 99px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--border);
  overflow: hidden;
}
.load-bar-fill {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #a78bfa, var(--accent));
  background-size: 200% 100%;
  animation: barSlide 1.6s linear infinite;
  transition: width 1.1s ease;
  box-shadow: 0 0 14px rgba(94,177,255,0.5);
}
@keyframes barSlide { to { background-position: -200% 0; } }
.load-steps {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  font-size: 13px; color: var(--muted);
}
.load-steps li { display: flex; align-items: center; gap: 10px; transition: color 0.4s; }
.ls-dot {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border); background: rgba(255,255,255,0.04);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; transition: all 0.4s;
}
.load-steps li.active { color: #fff; font-weight: 600; }
.load-steps li.active .ls-dot {
  border-color: var(--accent);
  animation: dotPulse 1.2s ease-in-out infinite;
}
@keyframes dotPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(94,177,255,0.5); }
  50% { box-shadow: 0 0 0 7px rgba(94,177,255,0); }
}
.load-steps li.done { color: var(--muted); }
.load-steps li.done .ls-dot { background: #22c55e; border-color: #22c55e; }
.load-steps li.done .ls-dot::after { content: "✓"; }

/* ---- details field: AI button + flash ---- */
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.btn.tiny {
  font-size: 12px; padding: 5px 12px; border-radius: 99px;
  background: linear-gradient(135deg, rgba(94,177,255,0.18), rgba(167,139,250,0.18));
  border: 1px solid rgba(94,177,255,0.4); color: #fff;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
}
.btn.tiny:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(94,177,255,0.35); }
.btn.tiny:disabled { opacity: 0.55; cursor: wait; }
textarea.flash { animation: taFlash 1.4s ease; }
@keyframes taFlash {
  0% { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(94,177,255,0.35); }
  100% { border-color: var(--border); box-shadow: none; }
}

.pal-dots { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.pal-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid #ffffff44; display: inline-block; }
