
@media (max-width: 768px) {

  /* -------------------------------
     IM REALLY GONNA BUST IF I DON'T PISS IMMEDIATELY
     ------------------------------- */
   body {
    padding: 0 8px;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
  }

  .modern-theme {
    scroll-behavior: smooth;
  }

  /* -------------------------------
     TITLE & SUBTITLE
     ------------------------------- */
   #title {
    font-size: 2.2rem;
    margin: 16px 0 8px;
  }

   #subtitle {
    display: none;
    font-size: 1rem;
    margin-bottom: 20px;
  }

  /* -------------------------------
     NAVBAR
     ------------------------------- */
   #navbar ul {
    flex-wrap: wrap;
    justify-content: center;
    padding: 6px;
    gap: 6px;
  }

   #navbar li {
    margin: 0;
  }

   #navbar a {
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  /* (mobile has no hover genius) */
   #navbar li:hover .dropdown {
    display: none;
  }

  /* -------------------------------
     EDITOR CONTAINER
     ------------------------------- */
   #editor-container {
    width: 95%;
    padding: 16px;
    margin: 0 auto 16px;
    border-radius: 14px;
  }

  /* -------------------------------
     TOOLBAR
     ------------------------------- */
   #toolbar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 8px 6px;
  }

   #toolbar button {
    min-width: 33px;
    min-height: 33px;
    padding: 9px;
    border-radius: 8px;
    touch-action: manipulation;
  }

   #toolbar button:active {
    transform: scale(0.96);
    filter: brightness(0.95);
  }

  /* -------------------------------
     EDITOR
     ------------------------------- */
   #editor {
    min-height: 45vh;
    font-size: 1.05rem;
    line-height: 1.6;
    padding: 14px;
    caret-color: #2b86c5;
    scroll-padding-bottom: 120px;
  }

  /* -------------------------------
     MENUS (SETTINGS / FILE / ETC)
     ------------------------------- */
 .menu {
  width: 100%;
  max-width: none;

  height: auto;
  max-height: 90vh; 
  padding: 16px;

  border-radius: 12px;

  overflow-y: auto;
  overscroll-behavior: contain;
}

 .menu h3 {
  font-size: 1.3rem;
  padding: 14px 16px;
}

 .menu button {
  min-height: 44px;
  font-size: 1rem;
}

.menu button:active {
  transform: scale(0.97);
}

@media (max-width: 600px) {
  .menu {
    top: 0;
    left: 0;
    transform: none;

    width: 100vw;
    height: 100vh;
    max-height: none;

    border-radius: 0;
  }
}

.ending-section {
  position: sticky
}


  /* -------------------------------
     SNAPSHOT SYSTEM
     ------------------------------- */
   #snapshotMenu {
    margin-top: 16px;
  }

   .snapshot-item {
    padding: 14px;
  }

   .snapshot-item strong {
    font-size: 1rem;
  }

   .snapshot-item button {
    width: 100%;
    min-height: 44px;
    margin-top: 6px;
  }

   #createSnapshotBtn {
    width: 100%;
    min-height: 48px;
  }

  /* -------------------------------
     CODEBLOCK
     ------------------------------- */
   .codeblock {
    font-size: 0.95rem;
    overflow-x: auto;
  }

  /* -------------------------------
     OVERLAY
     ------------------------------- */
   #overlay {
    backdrop-filter: blur(2px);
  }
}

/* Extra safety for very small screens */
/* i mean like actually very small like iphone 4s small type stuff */
/* oh yea just noticed 420 lmfaooooo.   */
@media (max-width: 420px) {

   #title {
    font-size: 2rem;
  }

   #toolbar button {
    padding: 10px;
  }
}