body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #1c1b22, #2a1e32);
  color: #f2f2f2;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.02), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.main-header {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.08); /* lighter glass effect */
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px) saturate(120%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  border-radius: 0 0 12px 12px;
}
.main-header h1 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.6rem;
  color: #e6d6ff;
  font-weight: 600;
  line-height: 1;
}
.main-header nav {
  display: flex;
  gap: 1rem;
}
.nav-btn {
  background: linear-gradient(145deg, #7f5ff0, #6b4ed0);
  border: none;
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, background 0.3s;
}
.nav-btn:hover {
  background: #8f6fff;
  transform: translateY(-2px);
}

.flag-svg {
  width: 1.6em;
  height: 1.2em;
  display: inline-block;
  vertical-align: middle;
}
.flag-svg svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

nav {
  margin-top: 1rem;
}

button {
  margin: 0 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: bold;
  background-color: #1c3f60;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

button:hover {
  background-color: #2c5a84;
}

main {
  padding: 2rem;
  max-width: 800px;
  margin: auto;
}

textarea {
  width: 100%;
  min-height: 100px;
  padding: 1rem;
  margin-top: 1rem;
  font-family: monospace;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2rem;
  background-color: rgba(255, 255, 255, 0.04); /* subtle table bg */
  border: 1px solid rgba(255, 255, 255, 0.1);  /* soft outer border */
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  padding: 0.6rem 1rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #e8e8e8;
}

th {
  background-color: rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

footer {
  text-align: center;
  padding: 1rem;
  color: #666;
}

#quizContainer {
  display: flex;
  justify-content: center;
}

#quizBox {
  text-align: center;
}

#quizBtns{
  display:flex;
  justify-content:space-between;   /* one left, one right */
  margin-top:1rem;                 /* the gap under the table */
}

.tool-btn {
  margin-top: 1.5rem; /* ~24px spacing */
}

#quizFeedback.correct { color: #4caf50; }  /* green ✔ */
#quizFeedback.wrong   { color: #f44336; }  /* red ✖ */

/* ---------- FORM & QUIZ CONTROLS ---------- */
input[type="text"],
textarea,
select,
button {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  color: #e8e8e8;
  outline: none;
  transition: background 0.2s, border-color 0.2s;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  background: rgba(255,255,255,0.07);
  border-color: rgba(160,132,255,0.55);
}

button {
  cursor: pointer;
  font-weight: 600;
  background: linear-gradient(135deg,#6d4dff 0%,#9e6dff 100%);
  color: #fff;
  border: none;
}

button:hover {
  filter: brightness(1.1);
}

#quizBox {       /* breathing room under the declension table */
  margin-top: 1.5rem;
}

/* ===== case-bar in header ===== */
.case-bar {
  display: none;                  /* shown via JS */
  gap: .5rem;
}

.case-btn {
  background: linear-gradient(145deg,#34c759,#2ba94f);
  padding: .35rem .8rem;
  font-size: .85rem;
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transition: transform .15s, filter .25s;
}
.case-btn:hover { filter: brightness(1.15); }
.case-btn:active { transform: translateY(1px); }

/* ===== declension table (dark-theme friendly) ===== */
.case-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.case-table th,
.case-table td {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.6rem 1rem;
  text-align: left;
  color: #f2f2f2;
}

.case-table th {
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

/* ===== highlighted “note / exceptions” box ===== */
.note {
  background: rgba(255, 255, 255, 0.07);
  border-left: 4px solid #39a446;
  padding: 0.8rem 1rem;
  border-radius: 6px;
  margin: 1rem 0;
  font-size: 0.95em;
  color: #e8e8e8;
}

#tenseTabs {
  margin-top: 1.2em;
  margin-bottom: 1em;
}

/* quiz grids */
.quiz-grid            {display:grid;grid-template-columns:repeat(auto-fit,minmax(60px,1fr));gap:.6rem;margin-top:1rem}
.quiz-grid .cell      {padding:.8rem 0;border:2px solid #6d4dff;border-radius:10px;font-size:1.4rem;font-weight:600;cursor:pointer;user-select:none;transition:.2s}
.quiz-grid .cell:hover{filter:brightness(1.15);transform:translateY(-2px)}
.cell.correct         {background:#34c759;color:#fff !important}
.cell.wrong           {background:#f44336;color:#fff !important}
.letter-type-btn      {padding:.6rem 1.4rem;border:none;border-radius:8px;font-weight:600;color:#fff;cursor:pointer}
.letter-type-btn.vowel{background:#ff7f50}
.letter-type-btn.cons {background:#1e90ff}
.letter-type-btn.sign {background:#8f6fff}
.letter-type-btn:hover{filter:brightness(1.12)}

/*  buttons row right-aligned  */
.quiz-controls{
  display:flex;
  justify-content:space-between;
  gap:1rem; margin:1.2rem 0;
}

/* feedback & result */
.msg{margin:.6rem 0;font-weight:600;min-height:1.2rem}
.msg.ok{color:#34c759}
.msg.bad{color:#ff3b30}

/* letters reference grid */
details.letters{margin:1.5rem 0}
.letters-grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(75px,1fr));gap:.5rem;margin-top:.8rem}
.letters-grid .cell{
  background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.1);
  padding:.55rem 0;border-radius:8px;text-align:center;font-size:1.35rem;font-weight:600}
.letters-grid .cell small{display:block;font-size:.7rem;font-weight:400;opacity:.85}
.letters-grid .vowel{background:#ff7f50}
.letters-grid .cons {background:#1e90ff}
.letters-grid .sign {background:#8f6fff}

.intro {
  padding: 2rem;
  max-width: 800px;
  margin: auto;
  line-height: 1.6;
}
.intro h1, .intro h2 {
  margin-top: 2rem;
  border-bottom: 2px solid rgba(255,255,255,0.2);
  padding-bottom: .4rem;
}
.intro ul {
  padding-left: 1.5rem;
}

.logo-text {
  font-weight: 600;
}

.home-icon {
  margin-left: 0.6rem;
  cursor: pointer;
  font-size: 1.2rem;
  user-select: none;
  opacity: 0.9;
  transition: transform 0.2s ease;
}
.home-icon:hover {
  transform: scale(1.5);
  opacity: 1;
}

.case-table tr.masc td:first-child { border-left: 4px solid #4f75d1; } /* blue */
.case-table tr.fem  td:first-child { border-left: 4px solid #ff7fcb; } /* pink */
.case-table tr.neut td:first-child { border-left: 4px solid #999999; } /* grey */

.case-table td.expected {
  background: rgba(255, 100, 100, 0.1);  /* soft red */
  border-left: 4px solid #e04848;
}

.case-table td.actual {
  background: rgba(100, 255, 100, 0.1);  /* soft green */
  border-left: 4px solid #46a646;
}

#verbBar {
  display: flex;
  gap: 0.6rem;
  margin: 1rem 0;
}

.aspect-table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 1rem;
  font-size: 0.95rem;
}
.aspect-table th,
.aspect-table td {
  padding: 10px;
  border: 1px solid #444;
  vertical-align: top;
}
.aspect-table th {
  background-color: #2c2c3a;
  color: #e0e0ff;
  text-align: left;
}
.verb-list {
  columns: 2;
  column-gap: 2rem;
  list-style-type: disc;
  margin-left: 1rem;
}

.aspect-quiz {
  color: #202638 !important;
  background: linear-gradient(110deg,#f5f7fa 60%,#dde8fc 100%);
  border-radius: 2rem;
  box-shadow: 0 8px 24px 0 rgba(31,38,135,0.08);
  margin: 2.5rem 0 0 0;
  padding: 2.2rem 1.2rem 1.6rem 1.2rem;
  animation: fadeInQuiz .6s;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}
@keyframes fadeInQuiz { from {opacity:0;transform:translateY(32px);} to{opacity:1;transform:translateY(0);} }
.aspect-quiz-q {
  font-size: 1.28rem;
  text-align: center;
  margin-bottom: 1.3rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.aspect-quiz-emoji { font-size:2.2rem; display:inline-block; margin:0 .3em; }
.aspect-quiz-btn-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.1rem;
  margin-bottom: 1rem;
}
.aspect-quiz-btn {
  font-size: 1.18rem;
  background: #fff;
  color: #204380;
  border: none;
  border-radius: 1.1rem;
  padding: 1.1rem 1.6rem;
  min-width: 122px;
  margin: 0.17rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  cursor: pointer;
  transition: background .17s, color .13s, transform .13s, box-shadow .12s;
  font-family: inherit;
  position: relative;
  outline: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.aspect-quiz-btn:active { transform: scale(0.98);}
.aspect-quiz-btn .aspect-quiz-tr {
  font-size: 0.85em;
  color: #7b8796;
  margin-top: .13em;
  line-height: 1.2;
}
.aspect-quiz-btn.correct { background: #caf3d2; color: #18724b; box-shadow:0 0 0 2px #55c79c2e;}
.aspect-quiz-btn.wrong   { background: #ffdede; color: #a22d36; box-shadow:0 0 0 2px #f4696940;}
.aspect-quiz-score {
  margin-top: .8rem;
  font-size: 1.06rem;
  text-align: center;
  color: #60769a;
}
.aspect-quiz-finish {
  font-size: 1.22rem;
  text-align: center;
  margin-top: 1.6rem;
  font-weight: 500;
}
.aspect-quiz-title {
  display: block;
  text-align: center;
  font-size: 1.35rem;
  font-weight: bold;
  text-decoration: underline;
  text-underline-offset: 0.22em;
  margin: 0 0 1.5rem 0;
  padding: 0.4em 0 0.4em 0;
  background: none;
  color: #234aa7;    /* Dark blue for strong contrast */
  letter-spacing: 0.01em;
}

@media (min-width: 600px) {
  .aspect-quiz-title {
    font-size: 1.65rem;
  }
}
/* Reflexive Quiz Block */
.reflexive-quiz {
  color: #212334 !important;
  background: linear-gradient(120deg,#eaf6ff 70%,#e3e0ff 100%);
  border-radius: 2rem;
  box-shadow: 0 8px 28px 0 rgba(30,44,140,0.11);
  margin: 2.5rem 0 0 0;
  padding: 2.2rem 1.2rem 1.8rem 1.2rem;
  animation: fadeInQuiz .6s;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  border: 2px solid #7a80ff;
}
.reflexive-quiz-title {
  display: block;
  text-align: center;
  font-size: 1.38rem;
  font-weight: bold;
  text-decoration: underline;
  text-underline-offset: 0.22em;
  margin: 0 0 1.7rem 0;
  padding: 0.5em 0 0.3em 0;
  background: none;
  color: #5147b7;
  letter-spacing: 0.01em;
}

/* The main question line */
.reflexive-quiz-q {
  font-size: 1.19rem;
  text-align: center;
  margin-bottom: 1.25rem;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.8;
}

/* Highlighted blocks for quiz prompt (NEW!) */
.quiz-verb {
  color: #3c43ee;
  background: #eaf2ff;
  padding: 0.13em 0.45em;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.09em;
  margin: 0 0.13em;
  letter-spacing: 0.01em;
  display: inline-block;
}
.quiz-tr {
  color: #fff;
  background: #9aa1d8;
  opacity: .98;
  font-size: .98em;
  font-weight: 500;
  border-radius: 8px;
  margin: 0 0.18em;
  padding: 0.11em 0.4em;
  display: inline-block;
}
.quiz-pron {
  color: #16c0b0;
  background: #e4fffa;
  font-weight: 700;
  padding: 0.11em 0.48em;
  border-radius: 8px;
  margin: 0 0.15em;
  font-size: 1.07em;
  display: inline-block;
  border: 1.5px solid #c5f4ef;
}
.quiz-tense {
  color: #a359fa;
  background: #f6ebff;
  font-weight: 700;
  padding: 0.11em 0.47em;
  border-radius: 8px;
  margin: 0 0.15em;
  font-size: 1.07em;
  display: inline-block;
  border: 1.5px solid #e3cafd;
}

/* End highlight blocks */

/* Legacy class for examples and translation, still in use */
.reflexive-quiz-tr {
  color: #677199;
  font-size: 1em;
  margin: 0.2em 0 0.5em 0;
}
.reflexive-quiz-pron {
  background: #f4eaff;
  color: #6a39c1;
  border-radius: 6px;
  font-weight: bold;
  font-size: 1.1em;
  padding: 0.18em 0.5em;
  margin: 0 0.2em;
}
.reflexive-quiz-input-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 0.7em;
  margin-bottom: 1em;
}
.reflexive-quiz input[type="text"] {
  min-width: 160px;
  max-width: 220px;
  text-align: center;
  font-size: 1.17rem;
  background: #fff;
  color: #2b2b54;
  border-radius: 8px;
  border: 1.5px solid #b9a6e9;
  margin-right: 0.2em;
}
.reflexive-quiz-btn {
  font-size: 1.05rem;
  background: #6d4dff;
  color: #fff;
  border: none;
  border-radius: 1.1rem;
  padding: 0.9rem 1.5rem;
  min-width: 100px;
  margin: 0.13rem;
  box-shadow: 0 2px 8px rgba(80,90,180,.07);
  cursor: pointer;
  transition: background .17s, color .13s, transform .13s, box-shadow .12s;
  font-family: inherit;
  position: relative;
  outline: none;
}
.reflexive-quiz-btn:active { transform: scale(0.98);}
.reflexive-quiz-btn.correct { background: #caf3d2; color: #18724b;}
.reflexive-quiz-btn.wrong   { background: #ffdede; color: #a22d36;}
.reflexive-quiz-feedback {
  margin-top: 0.8em;
  font-size: 1.16em;
  min-height: 1.5em;
  text-align: center;
  font-weight: 600;
}
.reflexive-quiz-feedback.correct { color: #4caf50; }
.reflexive-quiz-feedback.wrong   { color: #f44336; }
.reflexive-quiz-score {
  margin-top: .6rem;
  font-size: 1.01rem;
  text-align: center;
  color: #677199;
}
.reflexive-quiz-finish {
  font-size: 1.25rem;
  text-align: center;
  margin-top: 2.1rem;
  font-weight: 500;
}

/* Nice fade animation for quiz box */
@keyframes fadeInQuiz {
  from { opacity: 0; transform: translateY(24px);}
  to { opacity: 1; transform: none;}
}

/* Prefix Quiz wrapper tweaks */
#prefixQuizBox {
  margin-top: 1.5rem;      /* same breathing room as #quizBox */
  text-align: center;
}
#prefixQuizBox .quiz-question {
  font-size: 1.2rem;
  font-weight: 600;
}
#prefixQuizBox .quiz-score,
#prefixQuizBox .quiz-feedback {
  margin-top: 0.8rem;
  font-size: 1rem;
}
#prefixQuizBox .quiz-result {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
#prefixQuizBox #playAgainPrefix {
  /* matches other .tool-btn style */
  margin: 0.8rem auto 0;
  display: inline-block;
}

/* at the BOTTOM of global.css */
#prefixQuizBox .quiz-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;          /* same gap as your grid */
}

/* Shrink Prefix-Quiz buttons */
#prefixQuizBox .quiz-grid .cell {
  padding: 0.4rem 0.7rem !important;  /* less “fat” */
  font-size: 0.95rem    !important;  /* smaller text */
  min-width: 0           !important;  /* remove forced width */
  line-height: 1.2       !important;  /* tighter height */
}

#prefixQuizBox .quiz-feedback.correct {
  color: #4caf50;   /* green ✔ */
}
#prefixQuizBox .quiz-feedback.wrong {
  color: #f44336;   /* red ✖ */
}

.quick-ref td {
  border: none;
  font-size: 0.95rem;
  color: #e8e8e8;
}
.quick-ref strong {
  color: #fff;
}

.foundation-quiz {
  margin-top: 3rem;
  padding: 1.5rem;
  background: linear-gradient(110deg, #f9f9f9 60%, #eef6ff 100%);
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  color: #212638;
  max-width: 800px;
  margin: 0 auto;
}

.foundation-quiz-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
}

.foundation-quiz-q {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.foundation-quiz-btn-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.foundation-quiz-btn {
  background: #fff;
  color: #204380;
  border: 2px solid #204380;
  border-radius: 0.8rem;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.foundation-quiz-btn:hover {
  background: #204380;
  color: #fff;
}

.foundation-quiz-btn.correct {
  background: #caf3d2;
  border-color: #2a8f55;
  color: #18724b;
}

.foundation-quiz-btn.wrong {
  background: #ffdede;
  border-color: #c94444;
  color: #a22d36;
}

.foundation-quiz-feedback {
  text-align: center;
  font-weight: 600;
  min-height: 1.2em;
  margin-bottom: 0.6rem;
}

.foundation-quiz-feedback.correct {
  color: #2a8f55;
}

.foundation-quiz-feedback.wrong {
  color: #c94444;
}

.foundation-quiz-score {
  text-align: center;
  color: #60769a;
  margin-bottom: 1rem;
}

.foundation-quiz-finish {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 500;
}

.foundation-quiz-static {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: #333;
}

/* Single textarea rule: */
.foundation-quiz textarea {
  background: #fff;
  color: #212638 !important;
  height: 4rem;      /* initial height */
  max-height: 8rem;  /* allow internal scroll beyond this */
  resize: vertical;
  overflow-y: auto;
}

/* ——— Mobile-Friendly Overrides ——— */
@media (max-width: 600px) {
  /* Stack header elements vertically */
  .main-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1rem;
  }
  .main-header h1 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
  }
  /* Make nav buttons full-width and wrap */
  .main-header nav {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0;
  }
  .nav-btn {
    flex: 1 1 45%;
    text-align: center;
    padding: 0.6rem 0;
    font-size: 0.9rem;
  }
  /* Shrink the home icon */
  .home-icon {
    font-size: 1rem;
    margin-top: 0.25rem;
  }
  /* Make main content full-width and reduce padding */
  main, .intro {
    padding: 1rem;
    max-width: 100%;
  }
  /* Tables scroll horizontally if too wide */
  table, .case-table, .aspect-table {
    display: block;
    width: 100%;
    overflow-x: auto;
  }
  /* Ensure canvases (particles) fill screen */
  #particles {
    width: 100vw !important;
    height: 100vh !important;
  }
}

.foundation-quiz input[type="text"] {
  background: #fff;
  color: #2b2b54;
  font-weight: 600;
  border: 1.5px solid #b9a6e9;
}

.verb-notes {
  background: #2c2c3a;              /* darker panel */
  border-left: 4px solid #bfa6ff;   /* soft lavender accent */
  padding: 0.9rem 1.2rem;
  margin: 1.5rem 0;
  border-radius: 4px;
  color: #e9e9f1;                   /* light text */
  line-height: 1.6;
}

.verb-notes li {
  margin-bottom: 0.6rem;
}

