
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #fdf6ec; --surface: #ffffff; --surface2: #fafafa; --text: #263238;
  --muted: #78909c; --heading: #b71c1c; --border: #eceff1; --rowborder: #e0e0e0;
  --accent: #d32f2f; --accent2: #f57c00; --green: #2e7d32; --shadow: rgba(0,0,0,.08);
}
html[data-theme="dark"] {
  --bg: #17191c; --surface: #22262b; --surface2: #1d2024; --text: #eceff1;
  --muted: #90a4ae; --heading: #ef9a9a; --border: #33383f; --rowborder: #33383f;
  --accent: #ef5350; --accent2: #ffa726; --green: #66bb6a; --shadow: rgba(0,0,0,.4);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #17191c; --surface: #22262b; --surface2: #1d2024; --text: #eceff1;
    --muted: #90a4ae; --heading: #ef9a9a; --border: #33383f; --rowborder: #33383f;
    --accent: #ef5350; --accent2: #ffa726; --green: #66bb6a; --shadow: rgba(0,0,0,.4);
  }
}
body { font-family: "Hind Siliguri", "Noto Sans JP", "Noto Sans Bengali", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.55; }
.jp, .jp-text { font-family: "Noto Sans JP", "Hind Siliguri", sans-serif; }
a { color: var(--accent); }
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; max-width: 900px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand .logo { width: 38px; height: 38px; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #ff7043, #d32f2f);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: "Noto Sans JP", sans-serif; font-weight: 700; font-size: 20px;
  box-shadow: 0 2px 6px var(--shadow); }
.brand .name { font-weight: 700; font-size: 17px; }
#themeToggle { border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: 14px; }
.hero { background: linear-gradient(135deg, #d32f2f, #f57c00); color: #fff;
  text-align: center; padding: 52px 16px 40px; position: relative; overflow: hidden; }
.hero .sakura { font-size: 40px; animation: float 3s ease-in-out infinite; display: inline-block; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-6deg);} 50% { transform: translateY(-10px) rotate(6deg);} }
.hero h1 { font-size: 32px; margin: 10px 0 6px; animation: fadein 1.2s ease; }
.hero p { opacity: .95; animation: fadein 1.6s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(12px);} to { opacity: 1; transform: none;} }
.wrap { max-width: 760px; margin: 0 auto; padding: 12px 12px 30px; }
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; margin: 20px 0; }
.level-card { background: var(--surface); border-radius: 16px; padding: 22px 18px;
  text-align: center; box-shadow: 0 2px 10px var(--shadow); text-decoration: none; color: var(--text); }
.level-card .lv { font-size: 30px; font-weight: 700; color: var(--heading); }
.level-card .cnt { color: var(--muted); margin-top: 4px; }
.level-card.soon { opacity: .65; }
.badge { display: inline-block; background: var(--accent2); color: #fff; border-radius: 999px;
  padding: 2px 12px; font-size: 13px; margin-top: 8px; }
.card { background: var(--surface); border-radius: 16px; padding: 18px; margin: 18px 0;
  box-shadow: 0 2px 10px var(--shadow); }
.card h2 { font-size: 22px; margin-bottom: 10px; color: var(--heading); }
.card audio { width: 100%; margin: 6px 0; }
.player-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 2px; }
.player-tools .lbl { font-size: 14px; color: var(--muted); }
.tool-btn { border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  border-radius: 999px; padding: 6px 13px; cursor: pointer; font-size: 14px; }
.tool-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.words { margin: 10px 0; }
.row { display: flex; gap: 8px; padding: 6px 2px; border-bottom: 1px dotted var(--rowborder); font-size: 16px; }
.row:last-child { border-bottom: none; }
.row .jp { font-weight: 600; min-width: 38%; }
.row .dash { color: var(--muted); }
.dl { width: 100%; padding: 13px; font-size: 17px; border: none; border-radius: 10px;
  background: var(--green); color: #fff; cursor: pointer; margin-top: 10px; }
.dl:active { transform: scale(.98); }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.lesson-card { background: var(--surface); border-radius: 14px; padding: 16px 12px; text-align: center;
  box-shadow: 0 2px 8px var(--shadow); text-decoration: none; color: var(--text); }
.lesson-card .t { font-weight: 700; font-size: 17px; }
.lesson-card .c { color: var(--muted); font-size: 14px; margin-top: 2px; }
.prevnext { display: flex; justify-content: space-between; gap: 10px; margin: 22px 0 4px; }
.prevnext a { flex: 1; text-align: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 8px; text-decoration: none; color: var(--text); }
.prevnext a:hover { border-color: var(--accent); }
.searchbox { margin: 18px 0 6px; }
.searchbox input { width: 100%; padding: 13px 16px; font-size: 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-family: inherit; }
.search-results { margin-top: 10px; }
.search-results .hit { display: block; background: var(--surface); border-radius: 10px;
  padding: 9px 13px; margin: 7px 0; text-decoration: none; color: var(--text);
  box-shadow: 0 1px 5px var(--shadow); font-size: 15px; }
.search-results .hit .where { color: var(--muted); font-size: 13px; }
.ad-slot { margin: 20px 0; }
#gate { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none;
  align-items: center; justify-content: center; z-index: 50; padding: 16px; }
#gate .box { background: var(--surface); color: var(--text); border-radius: 16px;
  padding: 24px; max-width: 420px; width: 100%; text-align: center; }
#gate h3 { margin-bottom: 10px; }
#count { font-size: 44px; font-weight: 700; color: var(--accent); margin: 10px 0; }
#gateBtn { display: none; width: 100%; padding: 13px; font-size: 17px; border: none;
  border-radius: 10px; background: var(--green); color: #fff; cursor: pointer; text-decoration: none; }
#gateClose { margin-top: 12px; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; }
footer { text-align: center; color: var(--muted); padding: 26px 12px 42px; font-size: 14px; }
footer a { color: var(--muted); }
footer .flinks { margin: 8px 0; }
footer .flinks a { margin: 0 8px; }
.prose p { margin: 10px 0; }
.prose h2 { color: var(--heading); margin: 18px 0 8px; font-size: 21px; }
.prose ul { margin: 8px 0 8px 22px; }
.petal { position: fixed; top: -4vh; z-index: 1; pointer-events: none;
  background: radial-gradient(circle at 30% 30%, #ffd7e0, #f8a5bd);
  border-radius: 80% 0 80% 0; opacity: .85; animation: fall linear infinite; }
@keyframes fall {
  to { transform: translate3d(var(--sway, 40px), 108vh, 0) rotate(320deg); }
}
main, .topbar, footer, .hero { position: relative; z-index: 2; }
.hero { z-index: 1; }
