:root {
  --beige: #f7efe5;
  --beige-deep: #ead9c7;
  --brown: #5d3a2b;
  --brown-dark: #3f271d;
  --maroon: #7c2d2d;
  --maroon-soft: #a34d4d;
  --white: #fffdf9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--brown);
  background:
    radial-gradient(circle at top left, rgba(124, 45, 45, 0.15), transparent 24%),
    linear-gradient(135deg, var(--beige) 0%, var(--beige-deep) 100%);
  min-height: 100vh;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  z-index: 0;
  opacity: 0.28;
  pointer-events: none;
}

body::before {
  top: -70px;
  left: -70px;
  background: radial-gradient(circle, var(--maroon) 0%, transparent 70%);
}

body::after {
  bottom: -80px;
  right: -70px;
  background: radial-gradient(circle, var(--brown) 0%, transparent 70%);
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.hero-panel {
  background: linear-gradient(135deg, rgba(93, 58, 43, 0.94), rgba(124, 45, 45, 0.9));
  color: var(--white);
  border-radius: 32px;
  padding: clamp(1.5rem, 3vw, 3rem);
  box-shadow: 0 20px 50px rgba(61, 34, 20, 0.18);
  overflow: hidden;
  position: relative;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(120deg, rgba(255,255,255,0.14) 0%, transparent 45%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.eyebrow {
  margin: 0 0 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: #f3ddc2;
}

.hero-content h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.15;
}

.hero-content p {
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.7;
  color: #f7ebdc;
}

.highlights {
  list-style: none;
  padding: 0;
  margin: 1.4rem 0 0;
  display: grid;
  gap: 0.65rem;
}

.highlights li {
  padding: 0.7rem 0.9rem;
  border-left: 3px solid rgba(243, 221, 194, 0.8);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.form-panel {
  display: flex;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 470px;
  background: rgba(255, 251, 245, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(124, 45, 45, 0.12);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: 0 18px 45px rgba(61, 34, 20, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--white);
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--maroon), var(--brown));
}

.brand-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-subtitle {
  margin: 0.2rem 0 0;
  color: #8f674f;
  font-size: 0.9rem;
}

.login-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.6rem;
}

.form-intro {
  margin: 0 0 1.2rem;
  color: #80604d;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.95rem;
}

.field span {
  font-weight: 600;
  font-size: 0.95rem;
}

.field input {
  width: 100%;
  border: 1px solid rgba(93, 58, 43, 0.2);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  font-size: 0.95rem;
  background: #fffdf9;
  color: var(--brown-dark);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
  border-color: var(--maroon);
  box-shadow: 0 0 0 3px rgba(124, 45, 45, 0.12);
}

.options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 0.2rem 0 1rem;
  font-size: 0.92rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #76604e;
}

.options-row a,
.signup-link a {
  color: var(--maroon);
  text-decoration: none;
  font-weight: 600;
}

button {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  background: linear-gradient(135deg, var(--maroon), var(--brown));
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 24px rgba(124, 45, 45, 0.2);
}

button:hover {
  transform: translateY(-1px);
}

.signup-link {
  margin: 1rem 0 0;
  text-align: center;
  color: #76604e;
}

@media (max-width: 900px) {
  .page-shell {
    grid-template-columns: 1fr;
    padding: 1rem;
    row-gap: 1.5rem;
  }

  .hero-panel {
    min-height: auto;
    padding: clamp(1.5rem, 4vw, 2.2rem);
    transform: none;
  }

  .hero-content {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .page-shell {
    min-width: 320px;
    min-height: 640px;
  }

  .hero-panel {
    border-radius: 24px;
    padding: 1.2rem;
    min-height: 240px;
  }

  .hero-content h1 {
    font-size: clamp(1.8rem, 8vw, 2.2rem);
  }

  .hero-content p,
  .eyebrow,
  .highlights {
    text-align: center;
  }

  .highlights {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 1.25rem;
  }

  .options-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Lessons page */
.lessons-page {
  scroll-behavior: smooth;
}

.lessons-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(1rem, 2.5vw, 2rem);
  display: grid;
  grid-template-columns: minmax(260px, 25%) 1fr;
  gap: clamp(1.25rem, 2.5vw, 2.5rem);
  position: relative;
  z-index: 1;
}

.lesson-calendar {
  align-self: start;
  position: sticky;
  top: 1.5rem;
  padding: clamp(1.25rem, 2.2vw, 2rem);
  color: var(--white);
  background: linear-gradient(145deg, rgba(93, 58, 43, 0.97), rgba(124, 45, 45, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  box-shadow: 0 20px 50px rgba(61, 34, 20, 0.2);
  overflow: hidden;
}

.lesson-calendar::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -80px;
  bottom: -95px;
  border: 1px solid rgba(243, 221, 194, 0.28);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(243, 221, 194, 0.05), 0 0 0 44px rgba(243, 221, 194, 0.04);
  pointer-events: none;
}

.calendar-brand,
.lesson-calendar h1,
.calendar-kicker,
.calendar-intro,
.lesson-grid,
.logout-form {
  position: relative;
  z-index: 1;
}

.calendar-brand { margin-bottom: 2.5rem; }
.calendar-kicker { margin: 0 0 0.4rem; color: #f3ddc2; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; }
.lesson-calendar h1 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); }
.calendar-intro { margin: 0.55rem 0 1.5rem; color: #f7ebdc; line-height: 1.55; }

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
}

.lesson-grid a {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--white);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.lesson-grid a:hover,
.lesson-grid a:focus-visible {
  color: var(--maroon);
  background: #f3ddc2;
  outline: none;
  transform: translateY(-2px);
}

.logout-form { margin-top: 1.5rem; }
.logout-form button { padding: 0.7rem 1rem; background: rgba(255, 255, 255, 0.12); box-shadow: none; border: 1px solid rgba(255, 255, 255, 0.25); }

.lesson-content { padding: clamp(0.4rem, 1vw, 1rem) 0 4rem; min-width: 0; }
.lessons-welcome { max-width: 720px; margin: 1rem 0 2rem; }
.lessons-welcome .eyebrow { color: var(--maroon); font-weight: 700; }
.lessons-welcome h2 { margin: 0 0 0.65rem; color: var(--brown-dark); font-size: clamp(1.9rem, 4vw, 3.2rem); line-height: 1.12; }
.lessons-welcome > p:last-child { margin: 0; color: #80604d; line-height: 1.7; }

.lesson-list { display: grid; gap: 1rem; }
.lesson-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.2rem;
  padding: 1.25rem;
  scroll-margin-top: 1.5rem;
  background: rgba(255, 251, 245, 0.92);
  border: 1px solid rgba(124, 45, 45, 0.12);
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(61, 34, 20, 0.08);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.lesson-card:target { border-color: var(--maroon); box-shadow: 0 14px 34px rgba(124, 45, 45, 0.17); transform: translateY(-2px); }
.lesson-number { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; color: var(--white); background: linear-gradient(135deg, var(--maroon), var(--brown)); font-weight: 800; }
.lesson-label { margin: 0 0 0.2rem; color: var(--maroon); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.lesson-card h3 { margin: 0 0 0.35rem; color: var(--brown-dark); font-size: 1.2rem; }
.lesson-card div > p:last-child { margin: 0; color: #80604d; line-height: 1.55; }
.start-lesson { align-self: center; color: var(--maroon); font-weight: 700; text-decoration: none; white-space: nowrap; }
.start-lesson:hover { color: var(--brown-dark); }

.to-top { position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem); z-index: 2; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; color: var(--white); background: linear-gradient(135deg, var(--maroon), var(--brown)); box-shadow: 0 12px 24px rgba(124, 45, 45, 0.28); text-decoration: none; font-size: 1.45rem; transition: transform 0.2s ease; }
.to-top:hover { transform: translateY(-3px); }

/* Individual lesson media page */
.lesson-detail-shell { width: min(1040px, 100%); min-height: 100vh; margin: 0 auto; padding: clamp(1.25rem, 4vw, 3.5rem) clamp(1rem, 3vw, 2rem) 4rem; position: relative; z-index: 1; }
.back-to-lessons { display: inline-block; margin-bottom: 2.5rem; color: var(--maroon); font-weight: 700; text-decoration: none; }
.back-to-lessons:hover { color: var(--brown-dark); }
.lesson-detail-header { max-width: 680px; margin-bottom: 2.5rem; }
.lesson-detail-header .eyebrow { color: var(--maroon); font-weight: 700; }
.lesson-detail-header h1 { margin: 0 0 0.65rem; color: var(--brown-dark); font-size: clamp(2.3rem, 6vw, 4rem); line-height: 1.05; }
.lesson-detail-header > p:last-child { margin: 0; color: #80604d; font-size: 1.08rem; line-height: 1.65; }
.media-section + .media-section { margin-top: 2.5rem; }
.media-section h2, .empty-media h2 { margin: 0 0 1rem; color: var(--brown-dark); font-size: 1.5rem; }
.media-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1rem; }
.audio-list { grid-template-columns: minmax(0, 1fr); }
.media-card, .empty-media { background: rgba(255, 251, 245, 0.94); border: 1px solid rgba(124, 45, 45, 0.12); border-radius: 20px; box-shadow: 0 12px 30px rgba(61, 34, 20, 0.08); padding: 1.2rem; }
.media-card h3 { margin: 0 0 1rem; color: var(--brown-dark); font-size: 1rem; overflow-wrap: anywhere; }
.media-card audio, .media-card video { display: block; width: 100%; }
.media-card video { border-radius: 10px; background: var(--brown-dark); }
.games-intro { margin: -0.35rem 0 1rem; color: #80604d; line-height: 1.6; }
.game-list { grid-template-columns: repeat(auto-fit, minmax(180px, 220px)); }
.game-card { text-align: center; }
.game-card > a { display: inline-block; line-height: 0; }
.game-qr-image {
  display: block;
  width: clamp(132px, 18vw, 180px);
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  padding: 0.45rem;
  background: var(--white);
  border: 1px solid rgba(124, 45, 45, 0.14);
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.game-card > a:hover .game-qr-image,
.game-card > a:focus-visible .game-qr-image { transform: scale(1.04); box-shadow: 0 8px 18px rgba(61, 34, 20, 0.15); }
.game-card > a:focus-visible { outline: 3px solid rgba(124, 45, 45, 0.4); outline-offset: 4px; border-radius: 12px; }
.empty-media { max-width: 580px; }
.empty-media p { margin: 0; color: #80604d; line-height: 1.6; }

/* Keep audio controls full-width on compact screens, then group them into
   easy-to-scan columns as the lesson page has room. */
@media (min-width: 760px) {
  .audio-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1080px) {
  .audio-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .lessons-shell { grid-template-columns: 1fr; }
  .lesson-calendar { position: relative; top: auto; }
  .calendar-brand { margin-bottom: 1.5rem; }
  .lesson-grid { grid-template-columns: repeat(8, 1fr); }
  .lesson-content { padding-top: 0; }
}

@media (max-width: 560px) {
  .lessons-shell { padding: 1rem; gap: 1rem; }
  .lesson-calendar { border-radius: 24px; padding: 1.25rem; }
  .lesson-grid { grid-template-columns: repeat(6, 1fr); gap: 0.4rem; }
  .lesson-grid a { border-radius: 9px; }
  .lesson-card { grid-template-columns: auto 1fr; gap: 0.9rem; padding: 1rem; border-radius: 18px; }
  .start-lesson { grid-column: 2; justify-self: start; }
  .lesson-number { width: 46px; height: 46px; border-radius: 13px; }
}





 
