   :root {
      --keralaGreen: #004700; 
      --keralaNight: #000d08;
      --keralaShade: #001d08;
      --munnarTeaGarden: #00aa00;
      --ripeMango: #ff6600; 
      --mountainFog: #f0fff8; 
      --monsoonCloud: #333849;
      --backwaterBlue: #032094;
      --deepSeaDive: #001847;
    }

    body {
        background-color: var(--keralaGreen);
        color: var(--mountainFog); 
        font-family: Arial, Helvetica, sans-serif;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        gap: 5%; 
        margin: 0; 
    }

/* Navigation menu */
    .topnav {
        grid-area: navBar;
        overflow: hidden;
        background-color: var(--keralaNight);
        width: 100%;
    }

        .topnav #myLinks {
            display: none; /* Hidden by default */
            flex-direction: column;
            background-color: var(--keralaShade);  
        }

        .topnav a {
            color: var(--mountainFog);
            padding: 0.8rem; 
            font-size: 1.5rem; 
            display: block;
            text-align: center;
        }

        .active {
            background-color: var(--keralaNight);
            font-weight: 600;
            color: var(--mountainFog);
        }

        a {
            text-decoration: none;
            color: var(--mountainFog);
        }

        a:hover {
            text-decoration: none;
            font-weight: 700;
            color: var(--ripeMango);
        }

        .hiddenContent {
            display: none;
        }


    .mainContainer {
      display: flex; 
      flex-direction: column;
      justify-content: space-evenly;
      align-items: center;
      gap: 2vh; 
    }

    .cardContainer {
      min-height: 58vh; 
      max-height: fit-content; 
      width: 95vw; 
      margin-top: 2vh; 
      border: 3px solid var(--mountainFog);
      box-shadow: 5px 5px var(--keralaShade);
      background-color: #002d00ad;
      box-sizing: border-box;
      text-align: center;
      cursor: pointer;
    }

 

    .engCardItem {
      font-size: 1.45rem;
    }

    .malCardItem {
      font-size: 1.45rem;
    }

    .translit {
      display: block;
    }

    .cardItem {
      margin: 1vh 2vw; 
    }

    .cardItem.top{
      margin-top: 10px; 
    }

    .cardItem#category {
      font-size: 1rem; 
    }

    i.cardItem {
      font-size: 1rem; 
    }

    .cardButtons {
      display: flex; 
      flex-direction: column;
      justify-content: space-evenly;
      gap: 5px;
      width: 95vw; 
    } 

      .cardButtons > button {
        font-size: 1.25rem;
        padding: 1%; 
        box-shadow: 5px 5px var(--keralaShade); 
        min-height: 7vh;
        border-radius: 10px;
      }

      .nextPrevButtonsDiv {
        display: flex; 
        flex-direction: row-reverse; 
        justify-content: center;
        width: 100%;
      }

        .nextPrevButtonsDiv > button {
          font-size: 1.5rem;
          padding: 1%; 
          box-shadow: 5px 5px var(--keralaShade); 
          width: 50%;
          min-height: 7vh;
          border-radius: 10px;
        }

        .prevButton {
          display: flex;
          flex-direction: row-reverse;
          justify-content: center;
          align-items: center;
        }

          .prevButtonText {
            font-size: 1.7rem;
            margin-left: 10px;  
          }
        
        .nextButton {
          display: flex;
          flex-direction: row;
          justify-content: center;
          align-items: center;
          
        }

          .nextButtonText {
            font-size: 1.7rem; 
            margin-right: 10px;
          }
        
        .searchButton {
          background-color: var(--deepSeaDive);
          color: var(--mountainFog);
          text-shadow: #f0fff8 1px 1px 2px;
        }
        .searchButton:hover {
          background-color: var(--backwaterBlue);
          font-weight: 700;
        }

        .statsContainer {
          display: flex; 
          flex-direction: column;
          justify-content: center;
          align-items: center;
          width: clamp(fit-content, 320px, 90vw);
          margin-top: clamp(10px, 2vh, 20px); 
          margin-bottom: clamp(10px, 2vh, 20px);
          padding: clamp(10px, 2vh, 20px);
          box-sizing: border-box;
          gap: clamp(10px, 2vh, 20px);
        }

          .counter {
            width: clamp(fit-content, 300px, 90vw);
            min-height: fit-content;      
            height: 7vh; 
            text-align: center;
            margin-top: clamp(10px, 2vh, 20px);
            padding: clamp(10px, 2vh, 20px);
            box-sizing: border-box;
            background-color: var(--keralaNight);
            font-weight: 600;
            font-size: 1.25rem;
            color: var(--mountainFog);
            box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
            border-radius: 10px;
          }

          .counter:nth-last-of-type(1) {
            background-color: var(--deepSeaDive);
          }
          
          .cardsViewed {
            font-size: 1rem; 
            text-align: center;
            margin-top: clamp(10px, 2vh, 20px);
          }

      /* display is toggled in js for card content*/
      .translit-hidden {
        color: transparent !important;  /* or use visibility: hidden; but color:transparent keeps layout */
        user-select: none;              /* optional: prevents accidental selection/copy */
      }


      .footer {
        margin: 20px; 
        box-sizing: border-box;
        text-align: center;
      }
  /* Tablet & Larger */

  @media only screen and (min-width: 768px) {
    .body {
      min-height: fit-content
    }

    .topnav {
      display: flex; 
      flex-direction: row;
      font-size: 1.5rem;
      height: clamp (50px, 7vh, 70px);
      margin-bottom: 2vh;
    }

      .topnav > a {
          text-align: left;
      }
    
    .cardContainer {
      min-height: 60vh;
      margin-top: 0; 
    }

      .engCardItem {
        font-size: 1.8rem;
      }

      .malCardItem {
        font-size: 1.8rem;
      }
    
        .cardItem#category {
        font-size: 1.1rem; 
        }

        i.cardItem {
          font-size: 1.1rem; 
        }

    .cardButtons {
      grid-area: cardButtons; 
      display: flex;
      flex-direction: row;
      justify-content: center;
      gap: 0; 
    }
      .cardButtons > button {
        font-size: 1.8rem;
      }

      .nextPrevButtonsDiv {
        display: flex; 
        flex-direction: row-reverse; 
        justify-content: center;
        width: 60%;
      }
        .nextPrevButtonsDiv > button {
          font-size: 1.8rem;
          padding: 1%; 
        }

      .form > input {
        font-size: 1.25rem;
      }
      .form > button {
        font-size: 1.5rem;
      }

      .statsContainer {
        flex-direction: row; 
        justify-content: space-around;
        margin: 0;
        gap: 20px;

  }
  }
      /* display is toggled in js for card content 