/* ============================================================================
   منصة شغف — Shaghf Platform
   css/home.css — واجهة الطلاب (تصميم v4: حديث، أنيق، ومتجاوب بالكامل)
   ========================================================================== */

body.home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
}

body.home main {
  flex: 1;
}

/* ------------------------------------------------------------------ */
/*  1. Top bar                                                         */
/* ------------------------------------------------------------------ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(135deg, #5a46aa 0%, #7a63cc 55%, #9b6cb8 100%);
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 12px 26px -16px rgba(90, 70, 170, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.brand__text strong {
  max-width: 20ch;
  overflow: hidden;
  font-family: var(--font-brand);
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

.brand__text span {
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}

.topbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.topbar .kids-badge {
  font-size: 0.78rem;
  padding: 0.36rem 0.8rem;
}

.sound-toggle {
  gap: 0.35rem;
}

.sound-toggle__icon {
  font-size: 0.95rem;
  line-height: 1;
}

.sound-toggle[aria-pressed='true'] {
  background: #fbebef;
  border-color: #f2ccd6;
  color: #9f3552;
}

.admin-link {
  gap: 0.35rem;
}

/* ------------------------------------------------------------------ */
/*  2. Header accents                                                  */
/* ------------------------------------------------------------------ */

.hero {
  position: relative;
  padding-bottom: clamp(0.8rem, 2vw, 1.6rem);
}

.top-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: fit-content;
  max-width: 100%;
  margin: clamp(0.7rem, 2vw, 1.1rem) auto 0;
  padding: 0.55rem 1.15rem;
  border: 1px solid rgba(185, 138, 63, 0.28);
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #fff9ed 0%, #fdf3f7 100%);
  box-shadow: 0 12px 30px -26px rgba(80, 50, 30, 0.5);
  color: #7a5a35;
  font-size: 0.87rem;
  font-weight: 700;
  text-align: center;
}

.top-credit__text {
  margin: 0;
}

.top-credit__text strong {
  color: #563d72;
  font-weight: 800;
}

.top-credit__emoji {
  font-size: 1rem;
  line-height: 1;
}

.parents-note {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  max-width: 760px;
  margin: 1.35rem auto 0;
  padding: 0.85rem 1.1rem;
  border: 1px solid rgba(88, 70, 112, 0.1);
  border-inline-start: 3px solid #b98a3f;
  border-radius: 4px 14px 14px 4px;
  background: rgba(255, 252, 246, 0.66);
  box-shadow: 0 16px 38px -34px rgba(45, 32, 64, 0.35);
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.8;
  text-align: start;
}

.parents-note strong {
  color: var(--ink);
}

.parents-note__icon {
  flex-shrink: 0;
  font-size: 1.15rem;
  line-height: 1.5;
}

/* ------------------------------------------------------------------ */
/*  3. Hero content                                                    */
/* ------------------------------------------------------------------ */

.hero__content {
  position: relative;
  max-width: 880px;
  margin-inline: auto;
  padding: clamp(2.2rem, 5vw, 3.6rem) 0 clamp(2rem, 4vw, 2.8rem);
  text-align: center;
}

.hero__title {
  margin-top: 0.2rem;
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 5.8vw, 4.2rem);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.hero__title .gradient-text {
  background: linear-gradient(115deg, #4b388f 0%, #8a5aa6 55%, #c16183 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero__title-emoji {
  display: inline-block;
  margin-inline-start: 0.1em;
  font-size: 0.62em;
  vertical-align: 0.12em;
  transform-origin: 55% 75%;
  animation: title-wiggle 4.2s var(--ease) infinite;
}

@keyframes title-wiggle {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  40% { transform: rotate(7deg) translateY(-3px); }
  65% { transform: rotate(-4deg) translateY(-1px); }
}

.hero__tagline {
  margin-top: 0.85rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.02rem, 2vw, 1.3rem);
  color: var(--ink-soft);
}

.hero__desc {
  max-width: 56ch;
  margin: 0.7rem auto 0;
  font-size: clamp(0.93rem, 1.4vw, 1.02rem);
  line-height: 1.9;
  color: var(--ink-soft);
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  max-width: 720px;
  margin: 1.7rem auto 0;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 252, 246, 0.7);
  box-shadow: 0 18px 38px -34px rgba(45, 32, 64, 0.35);
  text-align: start;
}

.stat-tile--violet { border-top: 2px solid #6d58c9; }
.stat-tile--pink { border-top: 2px solid #c16183; }
.stat-tile--mint { border-top: 2px solid #5f8f7f; }

.stat-tile__icon {
  font-size: 1.1rem;
  line-height: 1;
}

.stat-tile strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat-tile--violet strong { color: #5a46aa; }
.stat-tile--pink strong { color: #a44f6e; }
.stat-tile--mint strong { color: #4c7a6b; }

.stat-tile__label {
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink-soft);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.55rem;
}

.hero__actions .btn {
  min-width: 185px;
}

/* Search ---------------------------------------------------------- */

.search {
  position: relative;
  max-width: 540px;
  margin: 1.7rem auto 0;
}

.search__input {
  width: 100%;
  min-height: 56px;
  padding: 0.85rem 3.1rem;
  border: 1px solid rgba(88, 70, 112, 0.16);
  border-radius: var(--radius-full);
  background: #fffdf9;
  box-shadow: 0 20px 44px -36px rgba(45, 32, 64, 0.4);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease),
    background-color var(--speed) var(--ease);
}

.search__input::placeholder {
  color: var(--ink-faint);
  font-weight: 400;
}

.search__input:focus {
  outline: none;
  border-color: #a38bd8;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(109, 88, 201, 0.12), 0 20px 44px -36px rgba(45, 32, 64, 0.4);
}

.search__icon {
  position: absolute;
  inset-inline-start: 1.1rem;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.5;
  pointer-events: none;
}

.search__clear {
  position: absolute;
  inset-inline-end: 0.65rem;
  top: 50%;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: rgba(88, 70, 112, 0.07);
  color: var(--ink-soft);
  font-size: 0.82rem;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}

.search__clear:hover {
  background: #fbebef;
  color: #9f3552;
}

.search__hint {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--ink-faint);
}

/* ------------------------------------------------------------------ */
/*  4. Classrooms                                                      */
/* ------------------------------------------------------------------ */

.sections {
  padding-block: 0.4rem clamp(2.5rem, 5vw, 4rem);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  margin-bottom: 1.3rem;
}

.section-heading__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  font-weight: 800;
  color: var(--ink);
}

.section-heading__subtitle {
  margin-top: 0.2rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.section-heading__meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.73rem;
  color: var(--ink-faint);
}

.classroom-list {
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

.classroom {
  position: relative;
  padding: clamp(1.05rem, 2vw, 1.55rem);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 252, 247, 0.72);
  box-shadow: 0 28px 64px -52px rgba(45, 32, 64, 0.4);
}

.classroom::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c1, #6d58c9) 0%, rgba(255, 255, 255, 0) 75%);
  opacity: 0.55;
}

.classroom__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  margin-bottom: 1rem;
}

.classroom__identity {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.classroom__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  background: var(--c-soft, #f1edfb);
  font-size: 1.45rem;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.classroom__name {
  font-family: var(--font-display);
  font-size: 1.16rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
}

.classroom__teacher {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.05rem;
  font-size: 0.79rem;
  color: var(--ink-soft);
}

.classroom__teacher::before {
  content: '👩‍🏫';
  font-size: 0.78rem;
  opacity: 0.8;
}

.classroom__count {
  flex-shrink: 0;
  background: var(--c-soft, #f1edfb);
  border-color: rgba(255, 255, 255, 0.85);
  color: var(--c-ink, #4b388f);
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 0.7rem;
}

.student-grid > li {
  display: flex;
  min-width: 0;
}

.student-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  width: 100%;
  min-height: 148px;
  padding: 0.95rem 0.9rem 0.8rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 3px solid var(--c1, #6d58c9);
  border-radius: var(--radius-md);
  background: #fffdfa;
  box-shadow: 0 14px 30px -28px rgba(45, 32, 64, 0.38);
  text-align: start;
  cursor: pointer;
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease),
    border-color var(--speed) var(--ease);
}

.student-card::after {
  content: '';
  position: absolute;
  top: -34px;
  inset-inline-end: -34px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--c2, #a893e0);
  opacity: 0.08;
  pointer-events: none;
}

.student-card:hover,
.student-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--c2, #a893e0);
  box-shadow: 0 22px 40px -28px var(--c1, #6d58c9);
}

.student-card:active {
  transform: translateY(-1px) scale(0.99);
}

.student-card__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  background: var(--c-soft, #f1edfb);
  font-size: 1.35rem;
  line-height: 1;
}

.student-card__name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.student-card__full {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-width: 100%;
  font-size: 0.67rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink-faint);
  overflow-wrap: anywhere;
}

.student-card__hint {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: auto;
  padding-top: 0.35rem;
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--c-ink, #4b388f);
  opacity: 0.78;
}

.student-card__hint::before {
  content: '✦';
  font-size: 0.72rem;
  color: var(--c1, #6d58c9);
}

.student-empty {
  grid-column: 1 / -1;
  padding: 1.2rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: rgba(255, 252, 247, 0.5);
  font-size: 0.84rem;
  color: var(--ink-soft);
  text-align: center;
}

.results-empty {
  margin-top: 1.1rem;
}

.no-results__query {
  color: var(--violet-deep);
  font-weight: 800;
}

/* ------------------------------------------------------------------ */
/*  5. Footer                                                          */
/* ------------------------------------------------------------------ */

.site-footer {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  background: #241c2f;
  color: rgba(255, 255, 255, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  padding-block: 1.5rem;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  font-size: 0.8rem;
}

.footer__credit {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.footer__credit-title {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.68);
}

.footer__credit-title strong {
  color: #e8c98f;
  font-weight: 800;
}

.footer__credit-emoji {
  font-size: 1rem;
  line-height: 1;
}

.footer__copy {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.44);
}

.footer__copy strong {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
}

.footer__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.footer__links a {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
}

.footer__links a:hover {
  color: #e8c98f;
  text-decoration: none;
}

.footer__made {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.footer__heart {
  display: inline-block;
  color: #d98ea8;
  animation: heart-beat 2.8s ease-in-out infinite;
}

.footer__dot {
  opacity: 0.3;
}

@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.18); }
  24% { transform: scale(1); }
  36% { transform: scale(1.12); }
  48% { transform: scale(1); }
}

/* ------------------------------------------------------------------ */
/*  6. Student card modal                                              */
/* ------------------------------------------------------------------ */

.card-modal {
  z-index: 100;
}

.card-modal .modal__backdrop {
  background: rgba(28, 20, 38, 0.48);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
  backdrop-filter: blur(10px) saturate(1.05);
}

.card-modal .modal__panel {
  width: min(600px, 100%);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 255, 255, 0.9), transparent 60%),
    linear-gradient(170deg, #fffdf9 0%, var(--c-soft, #f5f0e8) 150%);
  box-shadow: 0 48px 110px -40px rgba(28, 20, 38, 0.55);
}

.card-modal__close {
  position: absolute;
  top: 1rem;
  inset-inline-end: 1rem;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 249, 0.9);
  color: var(--ink-soft);
  font-size: 0.95rem;
  box-shadow: 0 8px 18px -16px rgba(45, 32, 64, 0.4);
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}

.card-modal__close:hover {
  background: #fbebef;
  color: #9f3552;
  transform: none;
}

.card-modal__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: clamp(1.8rem, 4.5vw, 2.7rem) clamp(1.2rem, 4vw, 2.4rem) clamp(1.4rem, 3.5vw, 2rem);
  overflow: hidden;
  text-align: center;
}

.card-modal__inner > * {
  position: relative;
  z-index: 2;
}

.card-modal__stars {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.card-star {
  position: absolute;
  z-index: 1;
  opacity: 0;
  animation: star-float 4.4s ease-in-out infinite;
  filter: drop-shadow(0 6px 12px rgba(109, 88, 201, 0.18));
  will-change: transform, opacity;
}

@keyframes star-float {
  0% { opacity: 0; transform: translateY(16px) scale(0.5) rotate(-10deg); }
  18% { opacity: 0.85; }
  55% { opacity: 0.7; transform: translateY(-12px) scale(1) rotate(8deg); }
  100% { opacity: 0; transform: translateY(-38px) scale(0.75) rotate(-5deg); }
}

.card-modal__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.85rem;
  border: 1px solid rgba(185, 138, 63, 0.25);
  border-radius: var(--radius-full);
  background: #faf1df;
  color: #8a6425;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.card-modal__badge::before {
  content: '✦';
  color: #b98a3f;
}

.card-modal__icon {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin-top: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 26px;
  background: linear-gradient(150deg, #ffffff 20%, #f7f1e9 100%);
  font-size: 2.85rem;
  line-height: 1;
  box-shadow: 0 22px 44px -24px var(--c1, #6d58c9), inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  animation: card-icon-pop 0.6s var(--ease-bounce) both;
}

@keyframes card-icon-pop {
  0% { opacity: 0; transform: scale(0.55) rotate(-12deg); }
  60% { opacity: 1; transform: scale(1.05) rotate(3deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.card-modal__name {
  margin-top: 0.2rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4.5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.card-modal__class {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.card-modal__daily {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  padding: 0.22rem 0.7rem;
  border: 1px solid rgba(185, 138, 63, 0.22);
  border-radius: var(--radius-full);
  background: #faf1df;
  color: #8a6425;
  font-size: 0.69rem;
  font-weight: 800;
}

.card-modal__message {
  position: relative;
  width: 100%;
  margin-top: 0.65rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid rgba(88, 70, 112, 0.1);
  border-radius: var(--radius-md);
  background: #fffdf9;
  box-shadow: 0 14px 34px -30px rgba(45, 32, 64, 0.4), inset 0 1px 0 #fff;
  font-size: clamp(0.97rem, 1.8vw, 1.08rem);
  font-weight: 600;
  line-height: 1.95;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.card-modal__message::before,
.card-modal__message::after {
  position: absolute;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: #d9c39a;
  opacity: 0.65;
}

.card-modal__message::before {
  content: '«';
  top: -0.5rem;
  inset-inline-start: 0.7rem;
}

.card-modal__message::after {
  content: '»';
  bottom: -1rem;
  inset-inline-end: 0.7rem;
}

.card-modal__teacher {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.6rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-full);
  background: var(--c-soft, #f1edfb);
  color: var(--c-ink, #4b388f);
  font-size: 0.79rem;
  font-weight: 600;
}

.card-modal__teacher-label {
  font-weight: 500;
  opacity: 0.72;
}

.card-modal__teacher strong {
  font-weight: 800;
}

.card-modal__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 110;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ------------------------------------------------------------------ */
/*  7. Responsive                                                      */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
  .student-grid {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.7rem;
  }

  .topbar__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .hero__content {
    padding-top: 1.8rem;
  }

  .hero__title {
    font-size: clamp(2.1rem, 8vw, 3rem);
  }

  .student-grid {
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  }
}

@media (max-width: 640px) {
  .brand__mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 1.15rem;
  }

  .brand__text strong {
    font-size: 1.2rem;
  }

  .brand__text span {
    font-size: 0.63rem;
  }

  .topbar .kids-badge {
    font-size: 0.72rem;
    padding: 0.3rem 0.65rem;
  }

  .sound-toggle {
    padding-inline: 0.7rem;
  }

  .sound-toggle__label {
    display: none;
  }

  .admin-link {
    padding-inline: 0.8rem;
  }

  .top-credit {
    width: 100%;
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
  }

  .parents-note {
    margin-top: 1rem;
    padding: 0.75rem 0.85rem;
    font-size: 0.79rem;
    border-radius: 4px 12px 12px 4px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.3rem;
  }

  .section-heading__meta {
    align-self: flex-end;
  }

  .classroom {
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .classroom__icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    font-size: 1.3rem;
  }

  .classroom__name {
    font-size: 1.06rem;
  }

  .classroom__count {
    font-size: 0.72rem;
  }

  .student-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .student-card {
    min-height: 142px;
    padding: 0.85rem 0.8rem 0.7rem;
    border-radius: 14px;
  }

  .student-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    font-size: 1.2rem;
  }

  .student-card__name {
    font-size: 0.96rem;
  }

  .student-card__full {
    font-size: 0.63rem;
  }

  .hero__actions {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }

  .hero__actions .btn {
    width: 100%;
    min-width: 0;
  }

  .search {
    margin-top: 1.3rem;
  }

  .footer__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
  }

  .footer__credit {
    align-items: center;
  }

  .footer__credit-title,
  .footer__links {
    justify-content: center;
  }

  .card-modal__icon {
    width: 78px;
    height: 78px;
    border-radius: 22px;
    font-size: 2.4rem;
  }

  .card-modal__name {
    font-size: clamp(1.45rem, 7vw, 1.9rem);
  }

  .card-modal__message {
    padding: 1rem 1rem;
    border-radius: 14px;
  }

  .card-modal__inner {
    padding-inline: 1.05rem;
  }

  .card-modal__actions {
    width: 100%;
  }

  .card-modal__actions .btn {
    flex: 1 1 auto;
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .topbar__actions .admin-link span {
    display: none;
  }

  .hero__stats {
    gap: 0.45rem;
  }

  .stat-tile {
    padding: 0.7rem 0.65rem;
    border-radius: 12px;
  }

  .stat-tile__icon {
    font-size: 0.95rem;
  }

  .stat-tile strong {
    font-size: 1.2rem;
  }

  .stat-tile__label {
    font-size: 0.67rem;
    line-height: 1.4;
  }

  .hero__title {
    font-size: clamp(1.95rem, 9vw, 2.5rem);
  }

  .hero__tagline {
    font-size: 0.98rem;
  }

  .hero__desc {
    font-size: 0.88rem;
  }

  .top-credit__emoji {
    font-size: 0.9rem;
  }

  .top-credit {
    font-size: 0.76rem;
  }

  .search__input {
    min-height: 52px;
  }

  .student-card {
    min-height: 136px;
  }

  .student-card__hint {
    font-size: 0.63rem;
  }
}

@media (max-width: 360px) {
  .topbar__actions .admin-link span {
    display: none;
  }

  .classroom__teacher {
    font-size: 0.73rem;
  }

  .student-card {
    min-height: 130px;
    padding: 0.75rem 0.7rem 0.65rem;
  }

  .student-card__full {
    -webkit-line-clamp: 2;
    font-size: 0.6rem;
  }
}

@media (max-height: 620px) and (max-width: 950px) {
  .card-modal .modal__panel {
    max-height: 92svh;
  }

  .card-modal__icon {
    width: 64px;
    height: 64px;
    font-size: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__title-emoji,
  .footer__heart,
  .card-star {
    animation: none !important;
  }
}
