:root {
  --night-0: #0b0e1f;
  --night-1: #141a36;
  --night-2: #1e2650;
  --gold: #ffd97a;
  --lav: #b9a7ff;
  --ink: #f2efff;
  --muted: #9aa0c7;
  --card: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.12);
  --accent: #8f7bff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: "Noto Sans Myanmar", "Pyidaungsu", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, #2b3568 0%, transparent 60%),
    radial-gradient(900px 500px at 10% 0%, #232a55 0%, transparent 55%),
    linear-gradient(180deg, var(--night-0), #0d1026 70%, #0b0e1f);
  min-height: 100vh;
}
.stars::before {
  content: "✦ ⋆ ✧ ･ﾟ ✧⋆ ✦";
  position: fixed; top: 12px; right: 16px;
  color: rgba(255, 217, 122, 0.35);
  font-size: 13px; letter-spacing: 6px;
  pointer-events: none;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 18px 16px 90px; }
header.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 2px 14px;
}
.brand { font-size: 22px; font-weight: 700; }
.brand small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.iconbtn {
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
  width: 42px; height: 42px; border-radius: 14px; font-size: 19px; cursor: pointer;
}
.hero {
  background: linear-gradient(135deg, #2a3270, #4a2f7a 60%, #6b3a7d);
  border: 1px solid var(--line); border-radius: 22px;
  padding: 22px 20px; margin-bottom: 18px; position: relative; overflow: hidden;
}
.hero .moon { font-size: 44px; }
.hero h2 { margin: 8px 0 6px; font-size: 21px; }
.hero p { margin: 0 0 14px; color: #d9d4ff; font-size: 14px; }
.btn {
  display: inline-block; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--gold), #ffb84d);
  color: #3a2a00; font-weight: 700; font-size: 16px;
  padding: 13px 22px; border-radius: 16px; font-family: inherit;
}
.btn.ghost {
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); font-weight: 600;
}
.btn.small { padding: 9px 14px; font-size: 14px; border-radius: 12px; }
.btn:disabled { opacity: 0.55; cursor: wait; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px; margin-bottom: 14px;
}
.card h3 { margin: 0 0 10px; font-size: 16px; }
label.f { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input[type=text], input[type=password], select, textarea {
  width: 100%; background: rgba(0,0,0,0.3); border: 1px solid var(--line);
  color: var(--ink); border-radius: 12px; padding: 11px 13px;
  font-size: 15px; font-family: inherit;
}
textarea { min-height: 70px; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: rgba(0,0,0,0.25); color: var(--ink);
  border-radius: 999px; padding: 9px 14px; font-size: 14px; cursor: pointer; font-family: inherit;
}
.chip.on { background: var(--accent); border-color: var(--accent); font-weight: 700; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.story-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; cursor: pointer; text-align: left; color: var(--ink);
  padding: 0; font-family: inherit; width: 100%;
}
.story-card img { width: 100%; height: 130px; object-fit: cover; display: block; background: #1a2044; }
.story-card .ph { height: 130px; display: flex; align-items: center; justify-content: center; font-size: 44px; background: linear-gradient(135deg, #232a55, #3a2a5e); }
.story-card .t { padding: 10px 12px 12px; }
.story-card .t b { font-size: 14px; display: block; }
.story-card .t span { font-size: 12px; color: var(--muted); }
.badge-new { background: var(--gold); color: #3a2a00; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 8px; margin-left: 6px; }
.section-title { font-size: 17px; margin: 20px 2px 12px; font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; font-size: 14px; }
.progress { display: none; text-align: center; padding: 26px 10px; }
.progress.show { display: block; }
.moon-spin { font-size: 46px; display: inline-block; animation: float 2.4s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.progress p { color: var(--muted); font-size: 14px; }
/* reader */
.reader { max-width: 640px; margin: 0 auto; padding: 16px 18px 90px; }
.reader .cover { width: 100%; border-radius: 20px; margin: 8px 0 4px; }
.reader h1 { font-size: 24px; margin: 14px 0 4px; }
.reader .meta { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.moral {
  background: linear-gradient(135deg, rgba(255,217,122,0.14), rgba(255,217,122,0.05));
  border: 1px solid rgba(255,217,122,0.35); border-radius: 14px;
  padding: 12px 14px; font-size: 14px; margin: 14px 0;
}
.scene img { width: 100%; border-radius: 16px; margin: 6px 0 2px; }
.scene h3 { font-size: 17px; color: var(--gold); margin: 18px 0 8px; }
.scene p { line-height: 2; font-size: 17px; }
.reader-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(11, 14, 31, 0.92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 8px; align-items: center; justify-content: center;
}
.toolbar { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin: 10px 0; }
.toolbar .iconbtn { width: 38px; height: 38px; font-size: 16px; }
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: #232a55; border: 1px solid var(--line); color: var(--ink);
  padding: 11px 18px; border-radius: 999px; font-size: 14px; display: none; z-index: 50;
}
.toast.show { display: block; }
a { color: var(--lav); }
.back { color: var(--ink); text-decoration: none; font-size: 15px; }
.note { font-size: 13px; color: var(--muted); }
.ok { color: #8fe3a8; } .err { color: #ff9d9d; }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; }
