:root {
  --bg: #0b0e1a;
  --panel: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.12);
  --text: #eef1ff;
  --muted: #9aa3c7;
  --accent: #8b5cf6;
  --accent2: #06b6d4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Sora', 'Noto Sans SC', 'Noto Sans JP', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.aurora {
  position: fixed;
  width: 60vw; height: 60vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  z-index: -1;
  animation: drift 18s ease-in-out infinite alternate;
}
.aurora-1 { background: #7c3aed; top: -20vw; left: -10vw; }
.aurora-2 { background: #0891b2; bottom: -20vw; right: -10vw; animation-delay: -9s; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(8vw, 6vh) scale(1.15); }
}

.nav {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1rem 5vw;
  position: sticky; top: 0;
  backdrop-filter: blur(14px);
  background: rgba(11, 14, 26, 0.7);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
.logo { font-size: 1.25rem; font-weight: 800; }
.nav-links { display: flex; gap: 1.25rem; flex: 1; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav-links a:hover { color: var(--text); }

.lang-select, select, textarea, input[type="file"] {
  background: rgba(255,255,255,0.07);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  font-size: 0.95rem;
  font-family: inherit;
}
select option { background: #141830; color: var(--text); }

main { max-width: 1000px; margin: 0 auto; padding: 0 5vw 4rem; }

.hero { text-align: center; padding: 5rem 0 3.5rem; }
.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #a78bfa, #22d3ee, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { color: var(--muted); font-size: 1.1rem; max-width: 640px; margin: 0 auto 2rem; line-height: 1.6; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-top: 2rem; }
.hero-badges span {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.btn {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border: none;
  font-weight: 600;
}
.btn-primary:disabled { opacity: 0.5; cursor: wait; transform: none; }
.btn-lg { padding: 0.9rem 1.8rem; font-size: 1.05rem; border-radius: 14px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  margin-top: 2.5rem;
  backdrop-filter: blur(10px);
}
.panel h2 { margin-bottom: 1.25rem; font-size: 1.5rem; }
.hidden { display: none; }

.fld { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 1.1rem; flex: 1; }
.fld > span { font-size: 0.9rem; color: var(--muted); }
textarea { resize: vertical; width: 100%; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }

.photo-preview { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.6rem; }
.photo-preview img {
  width: 84px; height: 84px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border);
}

.status { margin-top: 1rem; color: var(--muted); min-height: 1.4em; }
.status.error { color: #f87171; }

/* ---- Player ---- */
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  outline: none;
}
.scene {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center;
  padding: 6%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  background-size: cover;
  background-position: center;
}
.scene.active { opacity: 1; pointer-events: auto; }
.scene .overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.65)); }
.scene > * { position: relative; }

.scene h2 {
  font-size: clamp(1.4rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 0.6em;
  animation: rise 0.9s cubic-bezier(.2,.8,.2,1) both;
}
.scene .sub {
  font-size: clamp(0.9rem, 1.8vw, 1.3rem);
  opacity: 0.85;
  max-width: 80%;
  animation: rise 0.9s 0.25s cubic-bezier(.2,.8,.2,1) both;
}
.scene ul { list-style: none; max-width: 80%; text-align: left; }
.scene li {
  font-size: clamp(0.9rem, 1.9vw, 1.35rem);
  margin: 0.5em 0;
  padding-left: 1.6em;
  position: relative;
  animation: rise 0.7s cubic-bezier(.2,.8,.2,1) both;
}
.scene li::before { content: '✦'; position: absolute; left: 0; }
.scene li:nth-child(1) { animation-delay: .35s; } .scene li:nth-child(2) { animation-delay: .55s; }
.scene li:nth-child(3) { animation-delay: .75s; } .scene li:nth-child(4) { animation-delay: .95s; }
.scene li:nth-child(5) { animation-delay: 1.15s; }
.scene blockquote {
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: 600;
  max-width: 85%;
  animation: rise 0.9s 0.2s cubic-bezier(.2,.8,.2,1) both;
}
.scene .photo {
  max-width: 42%; max-height: 70%;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: zoomin 1s 0.3s cubic-bezier(.2,.8,.2,1) both;
}
.scene.split-layout { flex-direction: row; gap: 5%; text-align: left; align-items: center; }
.scene.split-layout .txt { flex: 1; display: flex; flex-direction: column; }
.scene.split-layout ul { max-width: 100%; }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes zoomin { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }

.player-controls { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; align-items: center; }
.music-toggle { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.9rem; cursor: pointer; }
.music-toggle input { accent-color: var(--accent); width: 1.1em; height: 1.1em; }
.progress { height: 4px; background: rgba(255,255,255,0.1); border-radius: 4px; margin-top: 1rem; overflow: hidden; }
#progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width 0.3s linear; }
.hint { color: var(--muted); font-size: 0.85rem; margin-top: 1rem; }

.how .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.card { background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 16px; padding: 1.4rem; }
.card-icon { font-size: 1.8rem; margin-bottom: 0.6rem; }
.card h3 { margin-bottom: 0.4rem; }
.card p { color: var(--muted); font-size: 0.92rem; line-height: 1.55; }

.footer { text-align: center; padding: 2.5rem 0; color: var(--muted); font-size: 0.9rem; }
.footer a { color: var(--accent2); text-decoration: none; }

@media (max-width: 640px) {
  .nav-links { display: none; }
  .panel { padding: 1.25rem; }
  .scene .photo { max-width: 60%; }
  .scene.split-layout { flex-direction: column; text-align: center; }
}

/* ---- auth & credits ---- */
.user-area { display: flex; align-items: center; gap: 0.6rem; }
.user-email { font-size: 0.85rem; color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.88rem; }
.credits-badge {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.88rem;
}
.credits-badge .free-left { color: var(--muted); font-size: 0.8rem; margin-left: 0.35rem; }

.modal.hidden { display: none; }
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-box {
  background: #141830;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  width: min(420px, 92vw);
  position: relative;
}
.modal-close {
  position: absolute; top: 0.9rem; right: 0.9rem;
  background: none; border: none; color: var(--muted);
  font-size: 1.1rem; cursor: pointer;
}
.auth-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.4rem; }
.auth-tab {
  flex: 1; padding: 0.6rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-family: inherit; font-size: 0.95rem; cursor: pointer;
}
.auth-tab.active { background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff; border: none; font-weight: 600; }
.modal-box input {
  background: rgba(255,255,255,0.07); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 0.6rem 0.8rem; font-size: 0.95rem; font-family: inherit; width: 100%;
}
#auth-submit { width: 100%; margin-top: 0.4rem; }

/* ---- buy credits ---- */
.pkg-card { text-align: center; position: relative; }
.pkg-card .pkg-credits { font-size: 2rem; font-weight: 800; }
.pkg-card .pkg-price { color: var(--accent2); font-size: 1.2rem; font-weight: 600; margin: 0.3rem 0 0.8rem; }
.pkg-card .pkg-per { color: var(--muted); font-size: 0.8rem; margin-bottom: 0.8rem; }
.pkg-card.best { border-color: var(--accent); box-shadow: 0 0 24px rgba(139,92,246,0.25); }
.pkg-best-tag {
  position: absolute; top: -10px; right: 12px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 999px; padding: 0.15rem 0.7rem; font-size: 0.72rem; font-weight: 700;
}
.pay-methods { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.8rem 0; }
.pay-method-btn {
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px; padding: 0.5rem 1rem;
  cursor: pointer; font-family: inherit; font-size: 0.9rem;
}
.pay-method-btn.active { border-color: var(--accent2); background: rgba(6,182,212,0.15); }
.pay-detail {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.2rem; margin-bottom: 1.2rem;
  line-height: 1.7; font-size: 0.95rem;
}
.pay-detail img { max-width: 220px; border-radius: 12px; display: block; margin-top: 0.6rem; }
.pay-detail code {
  background: rgba(255,255,255,0.1); padding: 0.2rem 0.5rem;
  border-radius: 6px; user-select: all; word-break: break-all;
}
.my-pay-row {
  display: flex; gap: 1rem; flex-wrap: wrap; justify-content: space-between;
  border-bottom: 1px solid var(--border); padding: 0.5rem 0; font-size: 0.88rem; color: var(--muted);
}
.pay-status-pending { color: #fbbf24; } .pay-status-approved { color: #34d399; } .pay-status-rejected { color: #f87171; }

/* ---- formats, chips, editing, demo ---- */
.stage.fmt-916 { aspect-ratio: 9 / 16; height: min(72vh, 640px); width: auto; margin: 0 auto; }
.stage.fmt-11 { aspect-ratio: 1 / 1; height: min(72vh, 560px); width: auto; margin: 0 auto; }
.stage.fmt-916 .scene.split-layout,
.stage.fmt-11 .scene.split-layout { flex-direction: column; text-align: center; gap: 3%; justify-content: flex-start; padding-top: 9%; }
.stage.fmt-916 .scene.split-layout .photo,
.stage.fmt-11 .scene.split-layout .photo { max-width: 75%; max-height: 42%; }
.stage.fmt-916 .scene .sub { max-width: 92%; }
.stage.fmt-916 .scene ul, .stage.fmt-11 .scene ul { max-width: 88%; }

.chips { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: -0.4rem 0 1rem; }
.chip {
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--muted); border-radius: 999px; padding: 0.35rem 0.9rem;
  font-size: 0.82rem; cursor: pointer; font-family: inherit;
}
.chip:hover { color: var(--text); border-color: var(--accent2); }

.stage.editing { outline: 2px dashed var(--accent2); outline-offset: 4px; }
.stage.editing .scene.active [contenteditable="true"] { cursor: text; border-radius: 6px; }
.stage.editing .scene.active [contenteditable="true"]:hover { background: rgba(255,255,255,0.08); }
#edit-toggle.active { border-color: var(--accent2); background: rgba(6,182,212,0.15); }

.demo-video { width: 100%; border-radius: 16px; border: 1px solid var(--border); display: block; }
