/* ===========================
   RESET + BASE STYLES
   =========================== */
html {
  font-size: 20px;   /* controls the base size of the entire site */
}

h3 {
  font-size: 1.7rem;  /* More visual separation from body */
  font-weight: 700;
  margin-top: 2.2rem;
  margin-bottom: 1.1rem;
  letter-spacing: 0.01em;
}

body {
  background-color: #f9f9f9;
  color: #333;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.4rem;   /* adjust if needed */
  line-height: 1.6;
  padding: 0 1rem;
}

a {
  color: #1976d2; /* A deep blue, modern and accessible */
  text-decoration: underline;
  transition: color 0.2s ease;
}

.hidden { display: none !important; }

ol
* { box-sizing: border-box; margin: 0; padding: 0; }

/* ===========================
   RESPONSIVE NAV
   =========================== */
@media (max-width: 600px) {
  header, .main { padding: 1rem; }
  .top-nav a { display: block; margin-bottom: 0.5rem; }
}

/* ===========================
   BUTTONS & TIER STATES
   =========================== */
.btn {
  background-color: #c62828;
  border-radius: 8px;
  color: white;
  display: inline-block;
  font-size: 0.8rem;
  margin: 0.5rem;
  padding: 0.7rem 1.4rem;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.button-group {
  display: flex;
  flex-wrap: nowrap;         /* Prevent line break */
  gap: 8px;                  /* Spacing between buttons */
  flex-wrap: wrap;           /* (Optional fallback) wrap only if truly necessary */
}

.button-group .btn-download {
  white-space: nowrap;       /* Prevent text from wrapping inside the button */
  flex-shrink: 0;            /* Prevent buttons from shrinking too small */
}

@media (max-width: 500px) {
  .button-group {
    flex-direction: column;
    align-items: flex-start;
  }
}

.btn:hover { background-color: #a31818; }

.btn-locked {
  background-color: #ccc;
  color: #666;
  cursor: not-allowed;
  position: relative;
  opacity: 0.6;
  display: inline-block;
  pointer-events: auto;
  text-align: center;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
}
.btn-locked::after {
  content: attr(data-tooltip);
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 5px 8px;
  font-size: 0.8rem;
  border-radius: 4px;
  white-space: nowrap;
  display: none;
  z-index: 10;
}
.btn-locked:hover::after { display: block; }

.btn-pay-item {
  background-color: #ffc107;
  color: black;
}
.btn-pay-item:hover { background-color: #e0a800; }

.btn-available {
  background-color: #2e7d32;
  color: white;
}
.btn-available:hover { background-color: #1b5e20; }

.btn-comingsoon {
  background: #f4f4f4;
  color: #888;
  border: 1px dashed #bbb;
  cursor: not-allowed;
  padding: 0.5em 1em;
  border-radius: 4px;
  opacity: 0.7;
}

/* ===========================
   HEADER/NAV
   =========================== */
header {
  display: flex;
  align-items: flex-start;
  background-color: #222;
  justify-content: space-between;
  color: white;
  padding: 1rem 1.5rem;
  gap: 1rem;
}
header h1 { margin-bottom: 0.5rem; }

.top-nav, .kanji-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  flex: 1;  /* This allows nav to expand and center itself */
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  background: rgba(30,30,30,0.98);
  padding: 0.5em;
  margin-bottom: 1.5em;
}

.top-nav a, .kanji-nav a {
  color: #fff;
  font-weight: bold;
  text-decoration: none;
  background: none;
  padding: 0.15em 0.6em;
  border-radius: 0.4em;
  transition: color 0.15s, background 0.15s;
}

.top-nav a:hover, .kanji-nav a:hover {
  color: #fff;
  background: #e53935; /* Brighter red, or use #e53935 for kanji pages */
  text-decoration: none;
}

.top-nav a.active, .kanji-nav a.active {
  color: #fff;
  background: #d32f2f;
}

.top-nav a:visited, .kanji-nav a:visited {
  color: #fff; /* No weird purple visited color */
}

.dropdown {
  position: relative;
}

.dropbtn {
  cursor: pointer;
  padding: 0.5em 0.75em;
  border-radius: 6px;
  color: #333;
  font-weight: 600;
}

.dropbtn:hover {
  background-color: #f0f0f0;
}

/* First level dropdown */
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #fff;
  min-width: 180px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
  padding: 0.5em 0;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content a {
  display: block;
  padding: 0.5em 1em;
  color: #333;
}

/* Submenu (e.g., Phase 1 nested under Course) */
.sub-dropdown {
  position: relative;
}

.dropdown-submenu {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  background-color: #fff !important; /* Force white background */
  min-width: 200px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  z-index: 101;
}

.sub-dropdown:hover .dropdown-submenu {
  display: block;
}

@media (max-width: 700px) {
  .top-nav {
    flex-wrap: wrap;
    gap: 0.6rem;
    font-size: 0.98rem;
  }
}
/* Fix submenu links being invisible due to inherited .top-nav styles */
/* Ensure dropdown links have consistent background and text color */
.dropdown-content a,
.dropdown-submenu a {
  background-color: #fff !important;  /* Optional if you're still getting transparency */
  color: #333 !important;  /* Force correct text color */
  padding: 0.5em 1em;
  display: block;
  text-decoration: none;
  white-space: nowrap;
}

/* Hover effect (optional: red tint like your site) */
.dropdown-content a:hover,
.dropdown-submenu a:hover {
  background-color: #ffe5e5 !important;     /* soft red background on hover */
  color: #a30000 !important;                /* darker red text */
}

/* ===========================
   "PILL LOOK" ON SIGN UP/LOGIN
   =========================== */

.user-pill {
  display: flex;
  align-items: center;
  background: #f7f7f7;
  border: 1px solid #eee;
  border-radius: 999px;
  padding: 0.75rem 0.75rem;
  color: black;
  font-size: 0.85rem;
  font-weight: 600;
  gap: 0.75em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.user-email {
  font-weight: bold;
  color: #222;
  margin-right: 0.5em;

}

.user-tier {
  padding: 0.17em 0.65em;
  margin-left: 0.25em;
  border-radius: 12px;
  font-size: 0.92em;
  font-weight: 600;
  background: #ffe5e5;
  color: #d03232;
  border: 1.5px solid #ffd0d0;
}

.user-tier.completionist {
  background: #e2ffe8;
  color: #0c9751;
  border: 1.5px solid #b2ebc5;
}
/* ...add more for other tiers if needed */

.kanji-nav a[disabled], .kanji-nav a.disabled, 
.top-nav a[disabled], .top-nav a.disabled {
  color: #ccc !important;
  background: #444 !important;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: none;
  opacity: 0.7;
}

/* If you use button for nav, style to match */
.kanji-nav .btn, .top-nav .btn {
  border: none;
  outline: none;
  background: #e53935;
  color: #fff;
  font-weight: bold;
  border-radius: 0.4em;
  padding: 0.1em 1em;
  transition: background 0.15s;
}
.kanji-nav .btn:disabled, .top-nav .btn:disabled {
  background: #444;
  color: #ccc;
  opacity: 0.7;
}

/* Adjust nav spacing for mobile if needed */
@media (max-width: 650px) {
  .top-nav, .kanji-nav {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* ===========================
   HERO
   =========================== */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}
.hero-banner {
  width: 100%;
  max-height: 350px;
  object-fit: cover;
  border-radius: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  margin-bottom: 1rem;
}
.tagline {
  text-align: center;
  font-size: 1.8rem;
  font-weight: bold;
  margin-top: -0.5rem;
}

/* ===========================
   MAIN LAYOUT
   =========================== */
header {
   display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  /* Add some margin or padding as needed */
  padding: 0.5rem 1rem 0.5rem 1rem;
}

#auth-container {
  margin-left: auto;
  display: flex;
  align-items: center;
  /* Optional: Add more styling here to look like a header user pill */
}

#auth-container button {
  background: #d03232;
  color: #fff;
  border: none;
  padding: 0.3em 1em;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 0.75em;
  transition: background 0.15s;
}
#auth-container button:hover {
  background: #ff4c4c;
}

main, .main {
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.05);
  margin: 2rem auto;
  max-width: 950px;
  padding: 2rem 1rem;
  font-size:1.4rem;
}

main h2 {
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
main h3 {
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
}

.kanji-progress-bar-container {
  max-width: 720px;
  margin: 0 auto 1.5rem auto;
  text-align: center;
}
.kanji-progress-label {
  font-size: 1rem;
  color: #666;
  margin-bottom: 0.2rem;
}
.kanji-progress-bar {
  background: #eee;
  border-radius: 8px;
  height: 10px;
  width: 80%;
  margin: 0 auto;
  overflow: hidden;
}
.kanji-progress-fill {
  background: linear-gradient(90deg, #ffa726, #ffd54f);
  height: 100%;
  border-radius: 8px 0 0 8px;
  transition: width 0.4s cubic-bezier(.4,0,.2,1);
}

/* ===========================
   HOME/LANDING (INDEX) PAGE
   =========================== */

  .index-section {
  gap: 1.5rem;
  margin: 2rem auto;
  max-width: 1200px;
  padding: 0 1rem;
  }

  .nav-button-start-purple {
  background-color: #8e44ad; /* Purple */
  color: white;
  font-weight: bold;
  padding: 0.65em 1.2em;
  border-radius: 8px;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.nav-button-start-purple:hover {
  background-color: #732d91; /* Darker purple on hover */
  transform: scale(1.04); /* Slight zoom effect */
}

/* Bounce animation */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Add bounce on hover to both classes */
.nav-button-start-purple:hover,
.btn:hover {
  animation: bounce 0.4s ease;
}

/* ===========================
   GRAPHEME INDEX STYLES
   =========================== */
  .grapheme-box {
  background: #f4fff8;
  border: 2px solid #b2dfdb;
  border-radius: 8px;
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  box-shadow: 0 0 8px rgba(0,0,0,0.04);
}
.grapheme-title {
  font-size: 1.4rem;
  color: #00796b;
  font-weight: bold;
}

   .grapheme-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 1rem;
  padding: 2rem;
  background-color: #f4fff8; /* Pale green */ 
  border: 2px solid #b2dfdb; /* Green border */
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
}

.grapheme-tile {
  display: block;
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  padding: 1rem;
  background-color: white;
  color: #00796b;
  border: 2px solid #f0f0f0;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.grapheme-tile:hover, .grapheme-tile:focus {
  background-color: #e8f5e9;
  border-color: #81c784;
  outline: none;
  transform: scale(1.05);
}
.grapheme-label {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.5rem;
  font-weight: normal;
}

/* ===========================
   KANJI INDEX STYLES (RED)
   =========================== */


.kanji-grid {
  background-color: #fff8f8;
  border: 2px solid #f4cccc;
  border-radius: 8px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.05);
  display: grid;
  font-size: 1.5rem;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin-bottom: 2rem;
  margin-top: 1rem;
  padding: 1.5rem 1rem;
  text-align: center;
  justify-content: center;
}

.kanji-tile {
  display: block;
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  padding: 0.5rem;
  background-color: white;
  color: #c62828;
  border: 2px solid #f0f0f0;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.kanji-tile:focus, .kanji-tile:hover {
  background-color: #ffecec;
  border-color: #ff9999;
  outline: none;
  transform: scale(1.05);
}

.kanji-label {
  color: #888;
  font-size: clamp(0.9rem, 2vw, 1.08rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.25;
  margin: 0.5em auto 0 auto;
  max-width: 100%;
  width: 100%;
  text-align: center;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;     /* Only show up to 3 lines */
  line-clamp: 3;             /* Standard property for compatibility */
  overflow: hidden;          /* Hide overflow */
  text-overflow: ellipsis;   /* ... on overflow */
  white-space: normal;       /* Allow wrapping */
  word-break: normal;        /* Only break at natural points */
  hyphens: auto;             /* Hyphenate if needed */
}

.kanji-check {
  margin-left: 0.4em;
  font-size: 1.2em;
  vertical-align: middle;
  color: #43a047; /* green, or pick your theme! */
}
.kanji-check.checked {
  /* Add glow or bold if you want */
  text-shadow: 0 0 3px #aee571;
}

/* ===========================
   KANJI PAGES
   =========================== */

.kanji-meaning {
  font-size: 2.5rem;
  font-weight: bold;
  color: #e53935;
  margin: 1.5rem 0 1rem 0;
  padding-left: 1.5rem;
}

.mnemonic-illustration {
  margin-bottom: 1em;
  text-align: center;
}

.mnemonic-illustration img {
  border-radius: 12px;    /* Soft, modern rounded corners */
  box-shadow: 0 2px 8px rgba(0,0,0,0.07); /* (Optional) gentle shadow for subtle depth */
}

.mnemonic-caption {
  font-size: 1.07em;
  color: #777;
  margin-top: 0.4em;
  font-style: italic;
}

.jp-vocab {
  font-size: 1.1em;     /* slightly bigger than base */
  font-family: "Noto Sans JP", "Meiryo", sans-serif; /* for legibility */
  letter-spacing: 0.03em;
  font-weight: bold;
}

.droplet-sidebar-ken {
  display: flex;
  align-items: flex-start;
  gap: 0.7em;
  background: rgba(240, 247, 250, 0.884);
  border-left: 6px solid #4fc3f7;
  box-shadow: 0 4px 18px 0 rgba(79,195,247,0.12);
  padding: 1em;
  border-radius: 12px;
  font-size: 0.95rem;
  width: 100%;
  box-sizing: border-box;
  margin: 1em 0;
}

.droplet-sidebar-mei {
  display: flex;
  align-items: flex-start;
  gap: 0.7em;
  background: rgba(232, 111, 46, 0.1);
  border-left: 6px solid rgba(232,110,46,0.8);
  box-shadow: 0 4px 18px rgba(79,195,247,0.12);
  padding: 1em;
  border-radius: 12px;
  font-size: 0.95rem;
  width: 100%;
  box-sizing: border-box;
  margin: 1em 0;
}

/* Float right and limit width on wider screens */
@media (min-width: 1000px) {
  .droplet-sidebar-mei, .droplet-sidebar-ken {
    float: right;
    width: 240px;
    margin-left: 1em;
    margin-bottom: 1em;
  }
}

/* Stack naturally on smaller screens */
@media (max-width: 999px) {
  .droplet-sidebar-mei, .droplet-sidebar-ken {
    float: none;
    width: 100%;
    margin: 1em 0;
  }
}

.droplet-icon {
  font-size: 2em;
  color: #29b6f6;
  margin-top: 0.1em;
}

.guide-sidebar-ken {
  position: absolute;
  right: -340px; /* Adjust for your layout */
  top: 0;
  width: 320px;
  background: #f8faff;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 0 0 2px #bbe1fa;
  padding: 1.2em 1.1em 1.1em 1.1em;
  display: flex;
  align-items: flex-start;
  font-size: 1rem;
  z-index: 5;
  min-height: 82px;
  margin-bottom: 1.5em;
  gap: 0.7em;
}

.guide-sidebar-mei {
  position: absolute;
  right: -340px; /* Adjust for your layout */
  top: 0;
  width: 320px;
  background: #f8faff;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 0 0 2px #bbe1fa;
  padding: 1.2em 1.1em 1.1em 1.1em;
  display: flex;
  align-items: flex-start;
  font-size: 1rem;
  z-index: 5;
  min-height: 82px;
  margin-bottom: 1.5em;
  gap: 0.7em;
}

.guide-face-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-shadow: 0 1px 5px rgba(0,0,0,0.08);
  flex-shrink: 0;
  object-fit: cover;
}

.guide-content {
  flex: 1;
  line-height: 1.5;
}

/* Responsive: drop below on mobile */
@media (max-width: 1100px) {
  .guide-sidebar {
    position: static;
    margin: 1.2em auto;
    max-width: 98%;
    min-width: unset;
    right: unset;
    box-shadow: none;
    flex-direction: row;
  }
}

.droplet-content {
  flex: 1;
}

@media (max-width: 900px) {
  .droplet-sidebar-ken, .droplet-sidebar-mei {
    position: static;
    margin: 1.2em auto;
    max-width: 98%;
    min-width: unset;
    right: unset;
    box-shadow: none;
  }
}

/* ===========================
   CHAPTER LIST STYLES (YELLOW/ORANGE)
   =========================== */
.chapter-card .chapter-check {
  font-size: 1.4em;
  margin-left: 0.25em;
  color: #2e7d32;
  vertical-align: middle;
}
.chapter-card.chapter-complete {
  box-shadow: 0 0 0 3px #81c78450;
  border-color: #4caf50;
  background: #f5ffe7;
}

.btn-mark-complete {
  background: #ccc;        /* Default gray */
  color: #555;    /* Dark gray text */
  border: 2px solid #bbb;
  border-radius: 6px;
  font-size: 1.15rem;
  padding: 0.7em 1.5em;
  cursor: pointer;
  font-weight: lighter;
  transition: background 0.2s, color 0.2s, border 0.2s;
}
.btn-mark-complete:hover {
  background: #e0e0e0;    /* Lighter gray on hover */
  color: #222;            /* Darker text on hover */
  border-color: #aaa;     /* Lighter border on hover */
  cursor: pointer;        /* Pointer cursor on hover */
  text-decoration: none;  /* No underline on hover */
  box-shadow: 0 1px 4px rgba(0,0,0,0.1); /* Subtle shadow on hover */
  transform: translateY(-1px); /* Slight lift on hover */
  transition: background 0.2s, color 0.2s, border 0.2s, box-shadow 0.2s, transform 0.2s;
}

.btn-mark-complete.not-complete {
  background: #ccc;         /* Gray when not complete */
  color: #555;
  border: 2px solid #bbb;
  transition: background 0.2s, color 0.2s, border 0.2s;
}

.btn-mark-complete.not-complete:hover {
  background: #e0e0e0;
  color: #222;
  border-color: #aaa;
}

.btn-mark-complete.completed {
  background: #2e7d32;      /* Green when completed */
  color: #fff;
  border: 2px solid #43a047;
  font-weight: bold;
  cursor: default;
  opacity: 1;
}

.complete-icon {
  font-size: 1.2em;     /* changed from 2em to 1.2em for more typical icon size */
  margin-right: 0.3em;
  vertical-align: middle;
}

.chapter-check {
  color: #43a047;
  margin-left: 0.4em;
  font-weight: bold;
  font-size: 1.3em;
  vertical-align: middle;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  justify-content: center;
  padding: 2rem 1rem;
  margin: 0 auto;
  max-width: 1200px;
}

.chapter-card {
  display: block;
  background: #fffde7;
  color: #aa5700;
  border: 2px solid #ffe082;
  border-radius: 16px;
  box-shadow: 0 1px 8px rgba(255, 193, 7, 0.04);
  text-align: center;
  font-size: 1.3rem;
  font-weight: bold;
  text-decoration: none;
  padding: 2rem 1rem 1.8rem 1rem;
  min-width: 180px;
  max-width: 240px;
  min-height: 90px;
  margin: 0 auto;
  transition: background 0.17s, border 0.17s, box-shadow 0.18s;
  cursor: pointer;
}
.chapter-card:hover {
  background: #ffe082;
  border-color: #ffa726;
}

/* Card title/subtitle styling for all grids */
.chapter-card .chapter-title,
.kanji-tile .kanji-big,
.grapheme-tile .grapheme-big {
  font-size: 2.1rem;
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.chapter-card span,
.grapheme-label {
  font-size: 1.1rem;
  color: #888;
  letter-spacing: 0.03em;
  font-weight: 400;
  margin-top: 0.2rem;
  display: block;
}

/* ===========================
   RESPONSIVE TWEAKS FOR GRIDS
   =========================== */
@media (max-width: 900px) {
  .chapter-grid,
  .kanji-index-grid,
  .grapheme-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
  }
  .chapter-card,
  .kanji-tile,
  .grapheme-tile {
    min-width: 100px;
    font-size: 1rem;
    padding: 1rem 0.5rem;
  }
}

/* =======================
   DOWNLOADS PAGE
   ======================= */
  .downloads {
    margin: 0 0 3.5em 0;
  }

  /* Make download labels less bold, a touch smaller, and less stark */
.download-card > strong {
  font-weight: bold;        /* Less bold than 700 */
  font-size: 1rem;         /* Same or slightly smaller than the button text */
  color: #333;             /* Not pure black */
  letter-spacing: 0.01em;  /* Optional: improve legibility */
  font-family: inherit;    /* Follows the page font, not browser default */
}

.anki-preview-img {
  max-width: 150px;
  border-radius: 0.9em;
  border: 1px solid #ffffff00; /* transparent border */
  box-shadow: none;            /* removes shadow */
  background: none;
}
.anki-preview-img:hover {
  transform: scale(3.05);      /* subtle zoom on hover */
  transition: transform 0.2s ease;
}

.songs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2em;
  justify-content: flex-start;
}

.song-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px 0 rgba(79,195,247,0.07);
  padding: 1.3em 1.2em;
  margin: 0.5em 0;
  max-width: 340px;
  min-width: 260px;
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: box-shadow 0.2s;
}

.song-card:hover {
  box-shadow: 0 6px 32px 0 rgba(79,195,247,0.13);
}

.song-artwork {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #4fc3f7;
  background: #eaf7fd;
  margin-bottom: 0.6em;
  transition: transform 0.2s ease; /* Smooth hover zoom */
}

.song-artwork:hover {
  transform: scale(2);           /* Gentle zoom effect */
}

.song-info {
  width: 100%;
}

.song-title {
  font-size: 1em;
  font-weight: 600;
  margin-bottom: 0.1em;
  color: #222;
}

.song-desc {
  color: #555;
  font-size: 0.9em;
  margin-bottom: 0.5em;
}

.song-preview {
  width: 100%;
  max-width: 220px;
  margin-bottom: 0.6em;
  margin-right: 1em;
}

.btn.btn-download {
  background: #4fc3f7;
  color: #fff;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: none;
  border: none;
  text-decoration: none;
  margin-top: 0.2em;
  transition: background 0.2s;
  display: inline-block;
}
.btn.btn-download:hover {
  background-color: #3366cc; /* darker blue */
}

@media (max-width: 900px) {
  .songs-list {
    flex-direction: column;
    gap: 1.5em;
  }
  .song-card {
    max-width: 98vw;
  }
}

/* =======================
   TUTORING PAGE
   ======================= */

.why-me-section {
  margin: 2em 0;
  background: #fff8f4;
  border-left: 5px solid #e86e2e;
  padding: 1em 1.5em;
  border-radius: 12px;
}

.testimonial-section {
  margin: 2em 0;
}

.testimonial-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5em;
  justify-content: center;
  margin-top: 1.5em;
}

.testimonial-card {
  background-color: #fefefe;
  border-left: 4px solid #e86e2e;
  padding: 1em;
  max-width: 420px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  flex: 1 1 300px;
}

.testimonial-img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

.testimonial-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  background-color: #f9f9f9;
  border: 2px dashed #e0a884;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.03);
}

.placeholder-text {
  font-size: 1em;
  font-style: italic;
  color: #aa6d38;
  text-align: center;
}

.testimonial-caption {
  font-size: 0.8em;
  color: #888;
  margin-top: 0.5em;
  text-align: right;
}

.schedule-section {
  margin-top: 2em;
}

.mei-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.7em;
  background: rgba(232, 111, 46, 0.08);
  border-left: 5px solid rgba(232,110,46,0.8);
  padding: 0.8em;
  border-radius: 12px;
  max-width: 420px;
  margin: 1em 0;
}

.mei-icon {
  width: 48px;
  height: auto;
  border-radius: 50%;
  box-shadow: 0 0 0 2px white;
}

.mei-bubble {
  font-size: 0.95em;
  color: #444;
}

.faq-section {
  margin-top: 3em;
}

.faq-section dl {
  margin: 1em 0;
}

.faq-section dt {
  font-weight: bold;
  margin-top: 1em;
  color: #333;
}

.faq-section dd {
  margin: 0.3em 0 1em 1em;
  color: #555;
}

.centered-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1.5em;
}

/* =======================
   REVIEW PAGE
   ======================= */

.review-h3 {
  text-align: center;
}

   /* ----- POPUP ----- */
#chapter-complete-popup {
  display: none;
  opacity: 1;
  transition: opacity 0.7s ease;
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fffbe7;
  border: 2px solid #ffae34;
  color: #d66400;
  font-weight: 600;
  font-size: 1.2rem;
  padding: 16px 36px;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(200,150,0,0.12);
  z-index: 999;
}

#chapter-complete-popup.fading {
  opacity: 0;
}

/* ----- ANKI DECK CARD ----- */
.anki-download-section {
  max-width: 420px;
  margin: 2em auto;
  background: #f7faff;
  border: 1.5px solid #b1ccf7;
  border-radius: 10px;
  padding: 1.2em 1.2em 1.5em 1.2em;
  font-size: 1rem;
  text-align: center;
}

.anki-download-section h3 {
  margin-top: 0.2em;
  font-size: 1.15em;
  font-weight: 600;
  color: #223e8d;
}

.anki-download-section .anki-download-note {
  margin-top: 0.6em;
  margin-bottom: 0.9em;
  color: #333;
  font-size: 0.97em; /* or font-size: 0.92em;*/
  line-height: 1.45;
  font-weight: 400;
}

.anki-download-section .btn, 
.anki-download-section button, 
.anki-download-section .btn-comingsoon {
  font-size: 0.96em;
  padding: 0.55em 1.1em;
}

.anki-download.card {
  margin: 1.2em 0 2em 0;
  padding: 1.4em 1em;
  background: #f3f4fd;
  border: 2px solid #5c6bc0;
  border-radius: 11px;
  box-shadow: 0 1px 5px rgba(44,44,80,0.07);
  text-align: center;
}
.btn.btn-anki {
  background: #5c6bc0;
  color: #fff;
  border: none;
  font-weight: bold;
  border-radius: 5px;
  padding: 0.4em 1.3em;
  font-size: 1.09rem;
  margin-top: 0.7em;
}
.btn.btn-anki:hover {
  background: #3949ab;
  color: #fffde7;
}

/* ----- MARK CHAPTER COMPLETE ----- */
.card {
  background: #fdfdfd;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  border: 1.5px solid #e0e0e0;
  padding: 1.5rem 1.7rem 1rem 1.7rem;
  margin-bottom: 1.4rem;
}

.card-green {
  background: #eafbe7;
  border-color: #b2dfdb;
  box-shadow: 0 1px 8px #a5d6a7a2;
}

/* ----- FONT TOGGLE ON KANJI PAGES----- */
.kanji-character {             
  font-size: 5rem;
  margin: 1rem 0;
  text-align: center;
}

.kanji-character.textbook {
  font-family: 'UD デジタル 教科書体 NP', 'UD デジタル 教科書体 N', 'UD Digi Kyokasho N-R', 'UD Digi Kyokasho NP-R', 'BIZ UDPゴシック', serif;
  /* Prefer UD first; BIZ UDP as fallback */
  font-size: 10rem; /* Adjusted for readability */
}

.kanji-character.handwritten {
  font-family: 'Zen Kurenaido', 'Kiwi Maru', 'Yusei Magic', sans-serif;
  font-size: 10rem; /* Adjusted for readability */
}

.kanji-character.newspaper {
  font-family: 'Yu Mincho', '游明朝', 'YuMincho', 'MS Mincho', serif;
  font-size: 10rem; /* Adjusted for readability */
}

.kanji-label-review.textbook, .kanji-review-char.textbook {
  font-family: 'UD Digi Kyokasho N-R', 'UD デジタル 教科書体 N', 'Zen Kurenaido', 'Yu Mincho', serif;
}
.kanji-label-review.handwritten, .kanji-review-char.handwritten {
  font-family: 'Zen Kurenaido', 'Kiwi Maru', 'Yusei Magic', sans-serif;
}
.kanji-label-review.newspaper, .kanji-review-char.newspaper {
  font-family: 'Yu Mincho', '游明朝', 'YuMincho', 'MS Mincho', serif;
}


.kanji-font-toggle {  
  font-size: 0.8em;   /* made smaller to put attention on kanji character */
  display: flex;
  gap: 0.7em;
}

.font-toggle-switch {
  display: flex;
  align-items: center;
  background: #f8f8f8;
  border: 1.5px solid #ddd;
  border-radius: 999px;
  padding: 0.35em 1.2em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border 0.15s;
}

.font-toggle-switch input {
  display: none;
}

.font-toggle-switch input[type="radio"] {
  accent-color: #e53935; /* Optional: matches site color */
  margin-right: 0.6em;
}
.font-toggle-switch input[type="radio"]:checked + .slider {
  background: #ffe082;
  border-color: #ffc107;
}

.font-toggle-switch .slider {
  position: relative;
  width: 46px;
  height: 26px;
  background: #ddd;
  border-radius: 18px;
  transition: background 0.2s;
  margin-right: 10px;
}

.font-toggle-switch .slider:before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.13);
}

.slider {
  display: none;  /*Hide if not using slider UI */
}

.font-toggle-switch input:checked + .slider {
  background: #43a047; /* green for active */
}

.font-toggle-switch input:checked + .slider:before {
  transform: translateX(20px);
}
.font-toggle-switch .toggle-label {
  margin-left: 2px;
  font-size: 1em;
}

/* ----- REVIEW GRID (6 cols desktop, 2-3 mobile)----- */
.review-kanji-grid, .kanji-review-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin: 2rem auto 2rem auto;
  max-width: 900px;
}

@media (max-width: 1000px) {
  .kanji-review-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .kanji-review-grid { grid-template-columns: repeat(2, 1fr); }
}

.review-block, .kanji-review-block {
  background: #fffdfa;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 10px;
  padding: 12px 6px 16px 6px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  position: relative;
  min-width: 80px;
  min-height: 94px;
}

.kanji-review-char {      /* all Kanji characters in review grid */
  font-size: 3rem;
  margin-bottom: 8px;
  font-family: inherit;
}

.kanji-review-char.textbook {
  font-family: 'UD デジタル 教科書体 NP', 'UD デジタル 教科書体 N', 'UD Digi Kyokasho N-R', 'UD Digi Kyokasho NP-R', 'BIZ UDPゴシック', serif;
  /* Prefer UD first; BIZ UDP as fallback */
  font-size: 5rem; /* Adjusted for readability */
}

.kanji-review-char.handwritten {
  font-family: 'Zen Kurenaido', 'Kiwi Maru', 'Yusei Magic', sans-serif;
  font-size: 3.3rem; /* Adjusted for readability */
}

.kanji-review-char.newspaper {
  font-family: 'Yu Mincho', '游明朝', 'YuMincho', 'MS Mincho', serif;
  font-size: 5rem; /* Adjusted for readability */
}

.kanji-review-meaning {
  font-size: 1.08rem;
  margin-bottom: 6px;
  transition: color 0.2s;
  cursor: pointer;
  user-select: none;
}

.review-block.card {
  padding: 0.7rem 0.4rem;
  text-align: center;
  font-size: 1rem;
  min-width: 0;
  min-height: 88px;
  border-radius: 9px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.04);
  background: #fff;
}

/* ----- CHECKBOXES ----- */
.kanji-checkbox {
  display: none;
}

.kanji-checkbox-custom {
  display: inline-block;
  width: 22px;
  height: 22px;
  background: #fff;
  border: 2px solid #dadada;
  border-radius: 6px;
  margin-top: 7px;
  margin-bottom: 2px;
  transition: border-color 0.2s;
  cursor: pointer;
  position: relative;
}

.kanji-checkbox:checked + .kanji-checkbox-custom {
  border-color: #ffae34;
  background: #fff9e3;
}

.kanji-checkbox-custom:after {
  content: '';
  display: none;
  position: absolute;
  left: 5px; top: 2px;
  width: 7px; height: 13px;
  border: solid #ffae34;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.kanji-checkbox:checked + .kanji-checkbox-custom:after {
  display: block;
}

.checkbox-row {
  display: flex;
  justify-content: center;
  gap: 0.19em;
  margin-top: 0.1em;
  flex-wrap: wrap;
  font-size: 0.98em;
}

.checkbox-row label {
  font-size: 1.05em;
  background: #f4f7fa;
  border-radius: 6px;
  padding: 0.35em 0.8em;
  border: 1px solid #e1e4e8;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background 0.17s;
}

.checkbox-row label:hover {
  background: #ffe08225;
}

.checkbox-row input[type="checkbox"] {
  accent-color: #e53935; /* Red (kanji theme) */
  margin-right: 0.5em;
  width: 1.1em;
  height: 1.1em;
}

.kanji-label-review {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.kanji-meaning-hidden {
  font-size: 1.07rem;
  font-weight: 600;
  color: #bdbdbd;
  filter: blur(0.7em);
  text-shadow: 0 0 3px #fff;
  cursor: pointer;
  background: rgba(250,250,250,0.6);
  padding: 0.12em 0.55em;
  border-radius: 3px;
  margin: 0.15em 0;
  letter-spacing: 0.05em;
  user-select: none;
}

.kanji-meaning-revealed {
  font-size: 1.07rem;
  font-weight: bold;
  color: #c62828;
  filter: none;
  background: transparent;
  text-shadow: none;
  margin: 0.1em 0;
}

.show-meaning-btn {
  background: #fffde7;
  color: #ff9800;
  font-weight: 600;
  border: 1px solid #ffd54f;
  border-radius: 5px;
  margin: 0.2em 0;
  padding: 0.08em 0.7em;
  cursor: pointer;
  transition: background .17s;
}
.show-meaning-btn:hover { background: #fff8e1; }

.review-complete-section {
  text-align: center;
  margin-bottom: 2.5rem;
  margin-top: 0.5rem;
}

/* ----- NOTES ON PRINTING THE REVIEW PAGE ----- */

.print-note {
  background: #fffde7;
  color: #aa5700;
  font-size: 1.07rem;
  border-radius: 6px;
  border-left: 6px solid #ffe082;
  padding: 0.7em 1.2em;
  margin: 1.2em 0 2em 0;
  display: flex;
  flex-direction: column;      /* NEW: Stack children vertically */
  align-items: flex-start;     /* Left-align text */
  gap: 0.25em;
}

.print-icon {
  font-size: 1.2em;
  opacity: 0.85;
}

/* ----- STYLING FOR THE ACTUAL PRINTS ----- */

@media print {
  .show-meaning-btn, #chapter-complete-popup, .anki-download.card, .review-complete-section { display: none !important; }
  .review-kanji-grid { grid-template-columns: repeat(6, 1fr) !important; }
  .review-block.card { font-size: 1.02rem; box-shadow: none; border: 1px solid #bbb; }
}


@media print {    
  body,
  html {
    background: none !important;
    color: #111 !important;
    font-size: 11px !important;
    margin: 0;
    padding: 0;
  }
  main,
  .main {
    background: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  header,             /* All of these will be hidden in the print */
  .top-nav,
  .nav-buttons,
  .print-note,
  .mnemonic-note,
  #auth-container,
  #chapter-complete-popup,
  .review-complete-section,
  .anki-download-section,
  .kanji-font-toggle,
  .notice,
  .faq-section,
  .review-h3,
  .btn-anki-unlock,
  footer {
    display: none !important;
  }
  .review-kanji-grid,
  .kanji-review-grid {
    /* Use 6 columns for A4 width */
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 2px !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding: 0 !important;
  }
  .review-block,
  .kanji-review-block,
  .card {
    background: none !important;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    border-radius: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 4px 2px !important;
    font-size: 10px !important;
  }
  .kanji-label-review {
    font-size: 14px !important;
    margin-bottom: 2px !important;
  }
  .checkbox-row label {
    font-size: 9px !important;
    padding: 1px 3px !important;
    border: none !important;
    background: none !important;
  }
  .kanji-checkbox-custom {
    width: 12px !important;
    height: 12px !important;
    border-radius: 2px !important;
    margin: 0 2px 0 0 !important;
  }
}

/* ===========================
          About Page
   =========================== */

   .about-short li, .about-long p li {
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 0.8rem;
  margin-left: 0.9rem;
   }

/* ===========================
          Plans Page
   =========================== */

.subscribe-button {
  display: inline-block;
  padding: 8px 14px; /* slightly smaller padding */
  font-size: 0.9rem; /* slightly smaller text */
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  background-color: #4CAF50;
  color: white;
  transition: background-color 0.3s ease;
  white-space: nowrap; /* prevents awkward text wrapping */
}

.subscribe-button.coming-soon {
  background-color: #ccc;
  color: #666;
  font-style: normal; /* remove italic */
  cursor: not-allowed;
  pointer-events: none;
}

.subscribe-button:hover:not(.coming-soon) {
  background-color: #45a049;
}

/* Coming Soon state */
.coming-soon {
  background-color: #ccc;
  color: #666;
  cursor: not-allowed;
  pointer-events: none;
}

/* Mobile-specific tweak */
@media (max-width: 600px) {
  .subscribe-button {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}


/* ===========================
   small elements shared across site
   =========================== */

.chapter-group {
  margin-bottom: 3rem;
}

.chapter-group h2 {
  border-bottom: 2px solid #ccc;
  margin-bottom: 1rem;
}

.chapter-intro {
  list-style-type: disc;
  padding-left: 1.5em;
}

.chapter-intro h2 {
  margin: 1.5rem 0 0.8rem;
}

.mnemonic,
.example-sentences {
  background-color: #fdfdfd;
  border-left: 4px solid #ccc;
  border-radius: 6px;
  margin-top: 2rem;
  padding: 1rem 1.5rem;
  font-size: 29px;
}

.example-sentences h3 {
  color: #444;
  font-size: 1.17em;
  margin-bottom: 0.8rem;
}

.example-sentences li, examples li {
  font-size: 29px;
  line-height: 1.5;
  margin-bottom: 0.8rem;
}

.example-sentences ul, .examples ul {
  list-style: none;
  padding-left: 0;
  font-size: 29px;
}

footer {
  color: #888;
  font-size: 0.9rem;
  margin: 2rem 0 1rem;
  text-align: center;
}
.grapheme {
  color: #00796b; /* Match the grapheme grid color */
  font-weight: bold;
}

.hint-toggle {
  display: inline-block;
  background-color: #ffe5cc;
  color: #b33c00;
  border-radius: 6px;
  padding: 2px 6px;
  margin-left: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9em;
  transition: background-color 0.2s ease;
}

.hint-toggle:hover {
  background-color: #ffcc99;
}

.hint-answer.hidden {
  display: none;
}

.intro h2 {
  color: #c62828;
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.intro h3 {
  color: #444;
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
}

.intro p {
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.intro ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.intro ul li {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.intro-box {
  background-color: #fdfdfd;
  border: 1px solid #ddd;
  border-left: 5px solid #aaa;
  margin-bottom: 3rem;
  padding: 2rem;
}

.intro hr {
  border: none;
  border-top: 2px solid #eee;
  margin: 2rem 0;
  position: relative;
  }

.faq-section {
  background-color: #fdfdfd;
  border: 1px solid #ddd;
  padding: 1.5rem;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  margin-top: 1rem;
  margin-bottom: 2rem;
  font-size: smaller;
}

.faq-section h3 {
  font-size: inherit;  /* Remove the override, match h3 everywhere */
}

.faq-item {
  margin-bottom: 3rem;
  text-align: left;
}

.faq-item summary {
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;     /* For better UX */
}

.faq-answer {
  margin-top: 0.5rem;
  margin-left: 1.5rem;
  margin-right: 1.5rem;
  color: #555;
  font-size: 1.05rem;
  line-height: 1.4;
}

.faq-answer p {
  margin-bottom: 1.5rem;
}

.kanji-evolution {
  display: block;
  max-width: 300px;
  margin: 1em auto;
}

.learning-section {
  background-color: #fdfdfd;
  border: 1px solid #ddd;
  padding: 1.5rem;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  margin-top: 1rem;
  margin-bottom: 2rem;
  transition: box-shadow 0.3s ease;
}

.learning-section:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.learning-section h4 {
  margin-top: 1.5rem;
  color: #c00;
}

/* HR inside the learning section */
.learning-section hr {
  border: none;
  border-top: 2px solid #eee;
  margin: 2rem 0;
  position: relative;
}

.learning-section hr::after {
  content: '✦';
  position: absolute;
  top: -0.9rem;
  left: 50%;
  transform: translateX(-50%);
  background: #fdfdfd;
  padding: 0 0.5rem;
  color: #ccc;
  font-size: 1.2rem;
}

.launch-note {
  text-align: center;
  color: #e63946;
  font-style: italic;
  font-size: 1rem;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

.locked-card {
  opacity: 0.5;
  pointer-events: none;
  background-color: #eee;
  color: #999;
  border: 2px dashed #bbb;
  position: relative;
}

.locked-card::after {
  content: "🔒 Locked";
  font-size: 0.9rem;
  position: absolute;
  top: 8px;
  right: 8px;
  background: #fff;
  color: #c00;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.login-prompt-msg {
  background: #fff8e1;
  border: 1px solid #f4b400;
  padding: 1em;
  margin-bottom: 1em;
  text-align: center;
  border-radius: 8px;
}
.login-prompt-msg a {
  color: #1976d2;
  text-decoration: underline;
  cursor: pointer;
}

.nav-buttons {
  margin-top: 2rem;
  text-align: center;
}

.notice,
.print-note {     /* large notes for readability */
  font-size: 1.13rem; 
  font-weight: 500;
}

.mnemonic-note {    /* small "side" notes */
  background: rgba(128,128,128,0.07);   
  border-left: 6px solid #ccc;
  padding: 0.75em 1em;
  margin: 1em 0;
  font-size: 0.9em;
  color: #666;
  font-style: italic; /* optional */
}

.notice {
  background-color: #fff7e0;
  border: 2px solid #ffe8a0;
  border-radius: 10px;
  box-shadow: 0 4px 14px 0 rgba(255, 200, 60, 0.15), 0 1.5px 4px 0 rgba(0,0,0,0.04);
  padding: 2rem 2.2rem 1.5rem 2.2rem;
  margin: 2rem auto 2.5rem auto;
  max-width: 950px;
}

.notice h3 {
  display: flex;
  align-items: center;
  font-weight: bold;
  font-size: 1.3rem;
  margin-top: 0;
  margin-bottom: 1.2rem;
}

.notice-icon {
  font-size: 1.45rem;
  margin-right: 0.55em;
  filter: drop-shadow(0 1px 2px #ffe06680);
}

.polaroid-section {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.polaroid {
  background: white;
  padding: 1rem;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
  width: 240px;
  text-align: center;
  font-family: 'Courier New', Courier, monospace;
}

.polaroid img {
  width: 100%;
  height: auto;
  display: block;
}

.polaroid .caption {
  margin-top: 0.5rem;
  font-size: 1.1rem;
  color: #444;
  font-family: 'Permanent Marker', 'Courier New', Courier, monospace;
  transform: rotate(-2deg);
}

.red {
  color: #d60000;
  font-weight: bold;
}

.green {
  color: #00796b !important;
  font-weight: bold;
}

.component {
  color: #e67e22;          /* A rich orange, adjust as needed */
  font-weight: 500;         /* Not as bold as .red */
  padding-bottom: 0.1em;
  font-size: smaller; /* Slightly smaller for emphasis */
}

.grapheme-component {
  color: #00796b !important;
  font-weight: 500;         /* Not as bold as .red */
  padding-bottom: 0.1em;
  font-size: smaller; /* Slightly smaller for emphasis */
}

.toc-container {
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  text-align: center;
}

.toc-container h3 {
  margin-bottom: 0.5rem;
}

.toc-links {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  text-decoration:none;
  align-items: center;
}

.toc-links a {
  text-decoration: none;
  color: #0055aa;
  font-weight: bold;
  transition: color 0.3s ease;
}

.toc-links a:hover {
  text-decoration:none;
}

.kanji-toc a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  font-weight: bold;
  font-size: 1.2rem;
  transition: color 0.3s ease;
  padding: 0.2rem;
  border-radius: 8px;
  color: #c62828; /* Match kanji tile color */
  background: rgba(255, 235, 238, 0.8); /* Light pink background */
  border: 2px solid #ffcdd2; /* Light red border */
}

.kanji-toc a:hover {
  color: #b71c1c; /* Darker red on hover */
  background: rgba(255, 205, 210, 0.9); /* Slightly darker pink */
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transform: translateY(-2px);
  transition: transform 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
}

.grapheme-toc a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  font-weight: bold;
  font-size: 1.2rem;
  transition: color 0.3s ease;
  padding: 0.2rem;
  border-radius: 8px;
  color: #1a8d80; /* Match grapheme tile color */
  background: rgba(224, 242, 241, 0.8); /* Light teal background */
  border: 2px solid #b2dfdb; /* Light green border */
}

.grapheme-toc a:hover {
  color: #013b32; /* Darker teal on hover */
  background: rgba(204, 235, 233, 0.9); /* Slightly darker teal */
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transform: translateY(-2px);
  transition: transform 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
}

/* ===========================
          Phase 2 Page
   =========================== */

   .phase2-waitlist {
  max-width: 480px;
  margin: 2em auto;
  background-color: #f7f7f7;
  padding: 1.5em;
  border-radius: 8px;
  text-align: center;
  font-size: 0.95em;
  color: #333;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.phase2-waitlist input[type="email"] {
  padding: 0.5em;
  width: 70%;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-top: 1em;
  margin-bottom: 1em;
  font-size: 1em;
}

.phase2-waitlist button {
  background-color: #6633cc;
  color: white;
  padding: 0.5em 1.2em;
  font-size: 1em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.phase2-waitlist button:hover {
  background-color: #562eb1;
}

.waitlist-response {
  font-size: 0.9em;
  margin-top: 1em;
  color: #007700;
}

/* ===========================
   Blog Landing Page
   =========================== */

.blog-hero {
  text-align: center;
  margin: 2em 0;
}

.blog-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5em;
}

.blog-hero p {
  font-size: 1.2rem;
  color: #777;
}

.blog-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin: 2rem auto;
  max-width: 1000px;
  padding: 0 1em;
}

.blog-toc {
  flex: 0 0 200px;
  background: #f4f4f4;
  border-radius: 8px;
  padding: 1em;
  font-size: 0.8em;
  position: sticky;
  top: 1em;
}

.blog-toc h2 {
  font-size: 1.1em;
  margin-top: 0;
  margin-bottom: 0.5em;
  color: #333;
}

.blog-toc ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.blog-toc li {
  margin: 0.4em 0;
}

.blog-toc a {
  text-decoration: none;
  color: #6633cc;
}

.blog-toc a:hover {
  text-decoration: underline;
}

.blog-toc-date {
  font-size: 0.75em;
  color: #999;
  margin-left: 0.4em;
}

.blog-toc-tags {
  font-size: 0.75rem;
  color: #666;
  line-height: 1.4;
}

.blog-toc-tags a {
  color: #666;
  text-decoration: none;
}

.blog-toc-tags a:hover {
  text-decoration: underline;
}

.blog-toc-tags a.active {
  font-weight: bold;
  text-decoration: underline;
  color: #6633cc;
}

.refresh-tip {
  font-size: 0.7rem;
  color: #888;
  margin-top: 3em;
  font-style: italic;
}

/* Grid Container */
.blog-grid {
  display: grid;
  gap: 2em;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  padding: 0 1em;
  margin-bottom: 3em;
}

/* Card Layout */
.blog-card {
  background: #fafafa;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease;
  opacity: 1;
  transform: scale(1);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card.hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.blog-card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  background: #fff;
  transform: translateY(-3px);
}

/* === Special "Pinned" Card Styling === */
.pinned-card {
  position: relative;
}

.pin-emoji {
  position: absolute;
  top: 0.5em;
  right: 0.75em;
  font-size: 1.2em;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}

/* Thumbnail Image */
.blog-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

/* Card Content */
.blog-content {
  padding: 1em 1.25em;
  flex-grow: 1;
}

.blog-content h2 {
  margin: 0 0 0.4em;
  font-size: 1.3rem;
  color: #333;
}

.blog-content .meta {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 0.8em;
}

.blog-content .blurb {
  font-size: 0.95rem;
  color: #666; /* softer gray for de-emphasis */
  line-height: 1.5;
  margin-bottom: 1em;
  text-decoration: none; /* ensure no underline */
}

/* Tag Styles */
.blog-tags {
  margin-top: auto;
}

.blog-tags span {
  display: inline-block;
  background: #e0e0e0;
  color: #333;
  font-size: 0.75rem;
  padding: 0.3em 0.6em;
  border-radius: 0.5em;
  margin-right: 0.4em;
  margin-bottom: 0.4em;
}

/* Optional Read More Link */
.read-more {
  font-size: 0.9em;
  color: #6633cc;
  font-weight: 600;
  text-decoration: none;
}

.read-more:hover {
  text-decoration: underline;
}

/* Responsive Tweak for Mobile */
@media (max-width: 480px) {
  .blog-thumb {
    height: 140px;
  }
}

.coming-soon {
  text-align: center;
  margin: 2em auto;
  padding: 1.5em;
  background-color: #f7f7f7;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #777;
  font-style: italic;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}