html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
video,
iframe,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

input,
select,
textarea,
button {
  font-size: 16px;
}

@media (max-width: 1024px) {
  #auth-container {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .carousel-container,
  .center-overlay {
    display: none !important;
  }

  body {
    justify-content: center !important;
    padding-right: 0 !important;
  }
}

@media (max-width: 768px) {
  body {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .max-w-7xl,
  .max-w-6xl,
  .max-w-5xl,
  .max-w-4xl,
  .max-w-3xl,
  .max-w-2xl,
  .max-w-xl,
  .max-w-lg,
  .max-w-md {
    max-width: 100% !important;
  }

  #parent-recovery-modal {
    justify-content: center !important;
    padding: 1rem;
  }

  #parent-recovery-modal > div {
    margin-right: 0 !important;
    max-width: 100% !important;
  }

  #scoreboard-overlay .max-w-3xl {
    max-width: 100% !important;
  }

  #scoreboard-overlay .p-8 {
    padding: 1rem !important;
  }

  #scoreboard-list {
    padding-right: 0 !important;
  }

  .course-indicator-arrow {
    margin-left: 0 !important;
  }

  #module-1-header h4 {
    font-size: 1rem;
    line-height: 1.35;
  }

  header .max-w-7xl {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  header .max-w-7xl > h1 {
    font-size: 1.05rem !important;
    line-height: 1.35;
  }

  header .max-w-7xl .space-x-3 {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  header .max-w-7xl .space-x-3 > * + * {
    margin-left: 0 !important;
  }

  header nav {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  header nav a {
    padding: 0.5rem 0.65rem !important;
    font-size: 0.84rem;
  }

  #scoreboard-button {
    width: 100%;
  }

  main li.flex.justify-between.items-center {
    align-items: flex-start;
    gap: 0.5rem;
  }

  main li.flex.justify-between.items-center > a {
    flex: 1;
    line-height: 1.35;
  }

  #auth-container {
    padding: 1rem !important;
  }

  #auth-container .tab-button {
    font-size: 0.95rem !important;
    padding-top: 0.65rem !important;
    padding-bottom: 0.65rem !important;
  }

  #auth-container input,
  #auth-container select,
  #auth-container button {
    min-height: 42px;
  }

  #cppQuizOverlay > div {
    width: 96vw !important;
    min-width: 0 !important;
    padding: 1rem !important;
  }

  #tutorialOverlay .tutorial-modal {
    width: 96vw !important;
    max-width: 96vw !important;
    padding: 1rem !important;
  }
}

@media (max-width: 480px) {
  body {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  .grid.grid-cols-1.md\:grid-cols-4 {
    gap: 0.75rem !important;
  }

  .text-3xl {
    font-size: 1.5rem !important;
    line-height: 1.2 !important;
  }
}
