/* ডিজাইন-টোকেন — আধুনিক জাপানি নান্দনিকতা: নরম রঙ, উষ্ণ নিরপেক্ষ পটভূমি */
:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --ink: #1f2430;
  --ink-soft: #5a6172;
  --line: #e6e2da;
  --brand: #c4453c;        /* বেনি (紅) লাল */
  --brand-soft: #fdeeec;
  --indigo: #33518f;       /* আই (藍) নীল */
  --indigo-soft: #ecf1fa;
  --green: #3d7d54;
  --gold: #b98a2f;
  --radius: 14px;
  --shadow: 0 1px 3px rgb(20 20 40 / .07), 0 8px 24px rgb(20 20 40 / .06);
  --font-bn: "Noto Sans Bengali", "Hind Siliguri", "Nirmala UI", "Vrinda", sans-serif;
  --font-ja: "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #15171d; --surface: #1e212a; --ink: #e8e6e1; --ink-soft: #a2a5b0;
    --line: #30343f; --brand-soft: #3a2523; --indigo-soft: #232c40;
    --shadow: 0 1px 3px rgb(0 0 0 / .4);
  }
}
:root[data-theme="dark"] {
  --bg: #15171d; --surface: #1e212a; --ink: #e8e6e1; --ink-soft: #a2a5b0;
  --line: #30343f; --brand-soft: #3a2523; --indigo-soft: #232c40;
  --shadow: 0 1px 3px rgb(0 0 0 / .4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-bn); line-height: 1.7; font-size: 17px;
}
:lang(ja) { font-family: var(--font-ja); }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

/* হেডার */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.nav { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font-family: var(--font-ja); font-weight: 700; font-size: 1.5rem; color: var(--brand); }
.brand-bn { font-family: var(--font-bn); color: var(--ink); font-size: 1.1rem; margin-left: 4px; }
.nav-links { display: flex; gap: 18px; align-items: center; }
.nav-links a { color: var(--ink); font-weight: 500; }

.btn {
  display: inline-block; padding: 9px 20px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }

/* হিরো */
.hero { padding: 72px 0 56px; text-align: center; }
.hero h1 { font-size: clamp(1.8rem, 4.5vw, 3rem); line-height: 1.35; margin: 0 0 14px; }
.hero .accent { color: var(--brand); }
.hero p { color: var(--ink-soft); max-width: 620px; margin: 0 auto 28px; }
.hero-ja { font-family: var(--font-ja); font-size: clamp(2.4rem, 7vw, 4rem); color: var(--indigo); letter-spacing: .1em; margin-bottom: 10px; }

/* কার্ড */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; padding: 30px 0 60px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); transition: transform .15s ease;
}
.card:hover { transform: translateY(-3px); }
.card h3 { margin: 0 0 8px; }
.card p { color: var(--ink-soft); margin: 0; font-size: .95rem; }
.card .ja { font-family: var(--font-ja); font-size: 1.9rem; color: var(--brand); display: block; margin-bottom: 8px; }

/* কানা গ্রিড */
.kana-section { margin: 34px 0; }
.kana-section h2 { border-inline-start: 4px solid var(--brand); padding-inline-start: 12px; font-size: 1.2rem; }
.kana-grid { display: grid; grid-template-columns: repeat(5, minmax(58px, 1fr)); gap: 10px; max-width: 560px; }
.kana-grid.wide { grid-template-columns: repeat(3, minmax(72px, 1fr)); max-width: 360px; }
.kana-cell {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 4px 8px; text-align: center; cursor: pointer; user-select: none;
  transition: transform .1s ease, border-color .1s ease; min-height: 76px;
}
.kana-cell:hover, .kana-cell:focus-visible { transform: scale(1.06); border-color: var(--brand); }
.kana-cell .glyph { font-family: var(--font-ja); font-size: 1.75rem; line-height: 1.2; display: block; }
.kana-cell .romaji { font-size: .72rem; color: var(--ink-soft); text-transform: lowercase; }
.kana-cell .bn { font-size: .8rem; color: var(--indigo); }

/* মডাল */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgb(15 15 25 / .55); backdrop-filter: blur(3px); padding: 20px;
  opacity: 0; transition: opacity .18s ease;
}
.modal-overlay.open { opacity: 1; }
.modal-card {
  position: relative; background: var(--surface); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgb(0 0 0 / .3); padding: 28px; width: 100%; max-width: 440px;
  max-height: 85vh; overflow-y: auto; text-align: center;
  transform: translateY(14px) scale(.97); transition: transform .18s ease;
}
.modal-overlay.open .modal-card { transform: translateY(0) scale(1); }
.modal-close { position: absolute; top: 10px; inset-inline-end: 12px; background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--ink-soft); padding: 6px; }
.modal-title { margin: 0 0 10px; font-size: 1.2rem; }
.modal-body-text { margin: 6px 0; }
.modal-error-text { color: var(--brand); }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
/* কানা-মডাল কনটেন্ট */
.modal-glyph { font-family: var(--font-ja); font-size: 5rem; line-height: 1.15; color: var(--brand); display: block; }
.modal-sound { font-weight: 700; color: var(--indigo); font-size: 1.15rem; }
.modal-mnemonic { color: var(--ink); margin: 10px 0; }
.audio-btn {
  background: var(--indigo-soft); color: var(--indigo); border: none; border-radius: 999px;
  width: 46px; height: 46px; font-size: 1.3rem; cursor: pointer; flex: none;
  transition: transform .1s ease;
}
.audio-btn:active { transform: scale(.92); }

/* ফুটার */
.site-footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 28px 0 40px; color: var(--ink-soft); font-size: .88rem; }
.disclaimer { font-size: .8rem; opacity: .85; }

/* ব্যাজ/চিপ */
.chip { display: inline-block; background: var(--indigo-soft); color: var(--indigo); border-radius: 999px; padding: 3px 12px; font-size: .8rem; font-weight: 600; }
.chip.red { background: var(--brand-soft); color: var(--brand); }

/* টেবিল (শিক্ষক-রোস্টার) */
.table-wrap { overflow-x: auto; }
.roster { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.roster th, .roster td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--line); font-size: .93rem; }
.roster th { background: var(--indigo-soft); color: var(--indigo); font-weight: 700; white-space: nowrap; }
.roster tr:last-child td { border-bottom: none; }

/* ফর্ম ও অথ-পেজ */
.auth-wrap { display: flex; justify-content: center; padding: 50px 0; }
.auth-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 34px; width: 100%; max-width: 430px;
}
.auth-card h1 { margin: 0 0 6px; font-size: 1.5rem; }
.auth-sub { color: var(--ink-soft); font-size: .92rem; margin-top: 0; }
.auth-card label { display: block; margin: 14px 0 4px; font-weight: 600; font-size: .95rem; }
.auth-card label .optional { font-weight: 400; color: var(--ink-soft); font-size: .82rem; }
.auth-card select {
  width: 100%; padding: 11px 14px; margin-top: 4px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg); color: var(--ink); font-family: inherit; font-size: 1rem;
}
.auth-card input[type="text"], .auth-card input[type="email"], .auth-card input[type="password"],
.inline-form input[type="text"] {
  width: 100%; padding: 11px 14px; margin-top: 4px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg); color: var(--ink); font-family: inherit; font-size: 1rem;
}
.auth-card input:focus, .inline-form input:focus { outline: 2px solid var(--indigo); border-color: var(--indigo); }
.auth-card .checkbox { font-weight: 400; display: flex; gap: 8px; align-items: center; }
.btn-block { width: 100%; margin-top: 18px; padding: 12px; font-size: 1.05rem; }
.auth-alt { text-align: center; font-size: .9rem; margin: 14px 0 0; }
.form-error { color: var(--brand); font-size: .85rem; margin: 4px 0; }
.inline-form { display: flex; gap: 10px; max-width: 340px; }
.inline-form input { flex: 1; }

@media (max-width: 640px) {
  .kana-grid { gap: 6px; }
  .kana-cell .glyph { font-size: 1.4rem; }
  .kana-detail .inner { gap: 14px; }
  .kana-detail .big-glyph { font-size: 3.2rem; }
}
