/* NIICHI — "Midnight indigo and coral" theme for the main app (index.html).
   Loaded after premium.css, so it only retunes what premium.css set.
   • Pure white page, near-black indigo text.
   • Midnight indigo for cards, selected states, progress and headings.
   • Coral for the one main action per screen, with a pressed-down edge.
   • Saffron for rewards (XP, streak).
   • Green and red stay for right/wrong and free/locked only.
   Delete the <link> in index.html to roll back. */

:root,
:root:has(.nh-home) {
  --nii-ink: #1E1B4B;
  --nii-ink-2: #312E81;
  --nii-coral: #FF6B4A;
  --nii-coral-hover: #F45A37;
  --nii-coral-edge: #C9472B;
  --nii-saffron: #F5A524;

  --color-bg: #FFFFFF;
  --color-surface: #FFFFFF;
  --color-text: #15132B;
  --color-muted: #5B5E78;
  --color-neutral-700: #5B5E78;
  --color-neutral-500: #9A9CB5;
  --color-neutral-400: #D4D5E3;
  --color-neutral-300: #E7E8F1;
  --color-neutral-200: #F2F3F8;
  --color-neutral-100: #F8F8FC;
  --color-divider: #ECEDF4;
  --color-border: #E3E4EF;

  --color-accent: #1E1B4B;
  --color-accent-100: #EEF0FF;
  --color-accent-200: #E0E3FF;
  --color-accent-300: #C7CBFB;
  --color-accent-400: #8B90E8;
  --color-accent-500: #4F46E5;
  --color-accent-600: #2B2770;
  --color-accent-700: #4338CA;
  --color-accent-2: #1E1B4B;
  --color-indigo: #1E1B4B;
  --color-indigo-100: #EEF0FF;

  --color-success: #15803D;
  --color-success-100: #DCFCE7;

  --pm-ring: 0 0 0 4px rgba(79, 70, 229, 0.18);
  --pm-glass: rgba(255, 255, 255, 0.88);
}
body, body:has(.nh-home) { background: #FFFFFF; }
::selection { background: #E0E3FF; color: #15132B; }
a { color: var(--color-accent-700); }
a:hover { color: var(--nii-ink); }

/* ── Buttons ─────────────────────────────────────────────────────────────
   Main action: coral with a darker bottom edge that presses down on click. */
.btn-primary,
.nh-btn:not(.nh-btn-line) {
  background: var(--nii-coral) !important;
  background-image: none !important;
  color: #fff !important;
  border: 0 !important;
  border-bottom: 3px solid var(--nii-coral-edge) !important;
  border-radius: 12px;
  box-shadow: 0 10px 22px -12px rgba(255, 107, 74, 0.85) !important;
  font-weight: 600;
  transition: background-color 160ms ease, transform 140ms ease, box-shadow 160ms ease, border-bottom-width 140ms ease;
}
.btn-primary:hover:not(:disabled),
.nh-btn:not(.nh-btn-line):hover {
  background: var(--nii-coral-hover) !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 14px 26px -12px rgba(255, 107, 74, 0.9) !important;
}
.btn-primary:active:not(:disabled),
.nh-btn:not(.nh-btn-line):active {
  transform: translateY(2px);
  border-bottom-width: 1px !important;
  box-shadow: 0 4px 10px -8px rgba(255, 107, 74, 0.9) !important;
}
/* Secondary: white with a crisp indigo outline */
.btn-secondary,
.nh-btn-line {
  background: #fff !important;
  color: var(--nii-ink) !important;
  border: 1.5px solid var(--nii-ink) !important;
  border-radius: 12px;
  box-shadow: none !important;
  font-weight: 600;
}
.btn-secondary:hover:not(:disabled),
.nh-btn-line:hover {
  background: var(--color-accent-100) !important;
  color: var(--nii-ink) !important;
  transform: translateY(-1px);
}
.btn-ghost { color: var(--nii-ink); }
.btn-ghost:hover { background: var(--color-accent-100) !important; }

/* ── Cards: crisp indigo outline with an offset shadow ──────────────────── */
.nb-card {
  position: relative; overflow: hidden; text-align: left; cursor: pointer;
  background: #fff; color: var(--nii-ink);
  border: 1.5px solid var(--nii-ink); border-radius: 16px;
  box-shadow: 5px 5px 0 var(--nii-ink);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
@media (hover: hover) {
  .nb-card:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--nii-ink); }
}
.nb-card:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--nii-ink); }
.nb-card.off { cursor: default; }
.nb-card.off:hover, .nb-card.off:active { transform: none; box-shadow: 5px 5px 0 var(--nii-ink); }

/* Course hub: bento grid */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(180px, auto); gap: 20px; padding: 0 6px 6px 0; }
.bt { display: flex; flex-direction: column; padding: 0; font-family: var(--font-body); }
.bt-kanji { grid-column: 1 / 3; grid-row: 1 / 3; background: var(--color-accent-100); }
.bt-vocab { grid-column: 3; grid-row: 1; }
.bt-grammar { grid-column: 4; grid-row: 1; }
.bt-read { grid-column: 3 / 5; grid-row: 2 / 4; }
.bt-listen { grid-column: 1 / 3; grid-row: 3; flex-direction: row; }
.bt-listen .bt-cover { width: 40%; aspect-ratio: auto; height: auto; min-height: 100%; border-bottom: 0; border-right: 1.5px solid var(--nii-ink); }
.bt-mock { grid-column: 1 / -1; grid-row: 4; background: #FFF4DB; }
.bt-mock .bt-body { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.bt-mock .bt-top { margin: 0; }
.bt-mock .bt-foot { margin: 0 0 0 auto; padding: 0; }
.bt-sample { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.bt-sample span { width: 54px; height: 54px; display: grid; place-items: center; background: #fff; border: 1.5px solid var(--nii-ink); border-radius: 12px; font-family: var(--font-jp); font-size: 26px; box-shadow: 3px 3px 0 var(--nii-ink); }
.bt-cover { display: block; width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-bottom: 1.5px solid var(--nii-ink); background: #EEF0FF; }
.bt-mark { position: absolute; right: -14px; bottom: -40px; font-family: var(--font-jp-serif); font-weight: 700; font-size: 220px; line-height: 1; color: #fff; pointer-events: none; }
.bt-body { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px 20px 18px; flex: 1 1 auto; }
.bt-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.bt-ico { min-width: 48px; height: 48px; padding: 0 8px; border-radius: 12px; background: #fff; border: 1.5px solid var(--nii-ink); display: grid; place-items: center; font-family: var(--font-jp); font-size: 17px; font-weight: 500; }
.bt-kanji .bt-ico { background: var(--nii-ink); color: #fff; }
.bt-n { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: var(--color-accent-700); }
.bt-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.bt-kanji .bt-title { font-size: clamp(28px, 3.4vw, 40px); }
.bt-meta { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-accent-700); }
.bt-note { font-family: 'Noto Sans Bengali', var(--font-body); font-size: 14px; line-height: 1.55; color: var(--color-muted); max-width: 46ch; }
.bt-foot { margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.bt-lock { font-family: 'Noto Sans Bengali', var(--font-body); font-size: 12.5px; font-weight: 600; color: var(--nii-ink); }
.bt-go { display: inline-flex; align-items: center; gap: 6px; font-family: 'Noto Sans Bengali', var(--font-body); font-size: 14px; font-weight: 700; color: #fff; background: var(--nii-coral); border-bottom: 3px solid var(--nii-coral-edge); padding: 6px 14px; border-radius: 10px; }
.bt-go:empty { display: none; }
@media (max-width: 960px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bt-kanji, .bt-read { grid-column: 1 / -1; grid-row: auto; }
  .bt-vocab, .bt-grammar { grid-column: auto; grid-row: auto; }
  .bt-listen, .bt-mock { grid-column: 1 / -1; grid-row: auto; }
}
@media (max-width: 520px) {
  .bento { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .bento > * { grid-column: 1 / -1 !important; }
  .bt-mark { font-size: 160px; }
  .bt-listen { flex-direction: column; }
  .bt-listen .bt-cover { width: 100%; aspect-ratio: 16 / 7; min-height: 0; border-right: 0; border-bottom: 1.5px solid var(--nii-ink); }
  .bt-sample span { width: 46px; height: 46px; font-size: 22px; }
}

/* Reading / listening lists use the same card */
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 20px; padding: 0 6px 6px 0; }
.set-card { display: flex; flex-direction: column; padding: 0; }
.set-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1.5px solid var(--nii-ink); background: #EEF0FF; }
.set-card.is-locked img { filter: grayscale(0.85); opacity: 0.7; }
.set-card.is-locked { box-shadow: 5px 5px 0 #C7C9DA; border-color: #C7C9DA; }

/* Homepage accents follow the theme */
.nh-home { --nh-red: #C8302A; --nh-ink: var(--nii-ink); }   /* home page red = the N5 grammar revision course's red */
/* Home hero buttons in that red: main action filled, the course link outlined */
.nh-home .nh-btn:not(.nh-btn-line) { background: #C8302A !important; border-bottom-color: #9E2420 !important; box-shadow: 0 10px 22px -12px rgba(200, 48, 42, 0.8) !important; }
.nh-home .nh-btn:not(.nh-btn-line):hover { background: #B42822 !important; box-shadow: 0 14px 26px -12px rgba(200, 48, 42, 0.85) !important; }
.nh-home .nh-btn-line { color: #C8302A !important; border-color: #C8302A !important; }
.nh-home .nh-btn-line:hover { background: #FBEDEB !important; color: #C8302A !important; }
.nh-lv.on, .nh-lv:hover { background: var(--nii-ink); }
.nh-tile:hover { background: var(--nii-ink); border-color: var(--nii-ink); box-shadow: 0 26px 50px -24px rgba(30, 27, 75, 0.55); }
.nh-end { background: var(--nii-ink); }

/* Bottom tab bar marker and focus rings */
.bottom-nav > button[aria-current="true"]::before { background: var(--nii-coral); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline-color: var(--color-accent-500); }

@media (prefers-reduced-motion: reduce) {
  .nb-card:hover, .nb-card:active, .btn-primary:hover, .btn-primary:active { transform: none !important; }
}
@media print {
  .btn-primary, .nb-card { box-shadow: none !important; }
}
