:root {
      --bg-dark: #0B0C10;
      --bg-mid: #1C1E26;
      --card-top: #242632;
      --card-bottom: #1A1C25;
      --surface-top: #2A2D3A;
      --surface-bottom: #20232E;
      --border-soft: rgba(255,255,255,0.06);
      --purple-dark: #1e1b4b;
      --purple-mid: #312e81;
      --glass-bg: rgba(51, 48, 108, 0.4);
      --glass-border: rgba(139, 92, 246, 0.2);
    }

    * { 
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      margin: 0;
      background: var(--bg);
      color: #e8f0ff;
      font-family: 'poppins', sans-serif;
      overflow: hidden;
      position: fixed;
      width: 100%;
      height: 100svh;
    }

    /* MAIN SECTION */
    #tamil-animal-quiz {
      height: 100svh;
      display: flex;
      flex-direction: column;
      padding: clamp(8px, 2vw, 16px);
      background: radial-gradient(ellipse 800px 600px at 30% 20%, rgba(88, 28, 135, 0.3), #00000042 70%), radial-gradient(ellipse 1000px 700px at 80% 80%, rgb(59 130 246 / 20%), transparent 70%), linear-gradient(169deg, #000000 0%, #182437 50%, #000000 100%);
    }

    .quiz-wrap {
      flex: 1;
      display: flex;
      flex-direction: column;
      max-width: 1200px;
      width: 100%;
      margin: 0 auto;
      min-height: 0;
    }

    /* HEADER */
    .quiz-topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      gap: 8px;
      flex-shrink: 0;
      min-height: 40px;
      padding: 14px 0px;
    }

    .brand-title {
      display: flex;
      align-items: center;
      gap: 6px;
      font-weight: 600;
      color: rgb(255, 255, 255);
      font-size: clamp(17px, 3.5vw, 24px);
      white-space: nowrap;
    }

    .brand-title img {
      width: clamp(24px, 5vw, 36px);
      height: clamp(24px, 5vw, 36px);
      flex-shrink: 0;
    }

    .top-controls {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }

    .chip {
      padding: 6px 12px;
      border-radius: 15px;
      font-weight: 600;
      background: #1C1C1E;
      border: 1px solid rgb(255 255 255 / 8%);
      backdrop-filter: blur(10px);
      color: #ffffff68;
      white-space: nowrap;
      font-size: clamp(14px, 2.5vw, 16px);
    }

    .chip .score-num {
      color: #ffffff;
      font-weight: 700;
      padding-right: 5px;
    }

    .translate-btn {
      padding: 6px 12px;
      border-radius: 15px;
      font-weight: 600;
      background: #1C1C1E;
      border: 1px solid rgb(255 255 255 / 8%);
      backdrop-filter: blur(10px);
      color: #ffffffc7;
      white-space: nowrap;
      font-size: clamp(15px, 2.5vw, 16px);
      cursor: pointer;
      transition: all 0.2s;
      font-family: 'poppins', sans-serif;
    }

    .translate-btn:hover {
      background: #2C2C2E;
      border-color: rgba(139, 92, 246, 0.3);
    }

    .translate-btn.active {
      background: #005fcc;
      border-color: rgba(139, 92, 246, 0.5);
      color: #ffffff;
    }

    .reset-btn {
      padding: 6px 12px;
      border-radius: 15px;
      font-weight: 600;
      color: rgb(0, 0, 0);
      background: #ffffff;
      border: 1px solid rgb(255 255 255 / 8%);
      backdrop-filter: blur(10px);
      cursor: pointer;
      white-space: nowrap;
      font-size: clamp(14px, 2.5vw, 16px);
      transition: all 0.2s;
      font-family: 'poppins', sans-serif;
    }

    .reset-btn:hover {
      background: rgba(255, 255, 255, 0.8);
    }

    /* CARD */
    .qa-card {
      flex: 1;
      display: flex;
      flex-direction: column;
      background: #000000bf;
      backdrop-filter: blur(50px);
       border: 1px solid rgba(255,255,255,0.06);
      box-shadow: 0 8px 32px 0 rgb(31 38 135 / 11%);
      border-radius: clamp(15px, 8vw, 30px);
      padding: clamp(10px, 2vh, 20px);
      overflow: hidden;
      min-height: 0;
      gap: clamp(8px, 1.5vh, 16px);
    }

    .topPane {
      flex: 1;
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 0;
      overflow: hidden;
    }

    .animal-pic-wrap {
      width: 100%;
      height: 100%;
      max-width: min(83vw, 400px);
      max-height: min(35vh, 400px);
      display: flex;
      align-items: center;
      justify-content: center;
      
      border-radius: 15px;
    }
    .audio-options {
    display: grid !important;
    grid-template-columns: repeat(1, 1fr) !important;
}

    .animal-pic {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain!important;
    }

    .bottomPane {
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      gap: clamp(8px, 1.5vh, 14px);
      min-height: 0;
    }

    .q-text {
      text-align: center;
      font-size: clamp(23px, 3.5vw, 28px);
      font-weight: 600;
      line-height: 1.3;
      flex-shrink: 0;
      padding: 10px;
    }

    .options {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: clamp(8px, 1.5vh, 12px);
      width: 100%;
    }

    .option {
      
      background: #1C1C1E;
      backdrop-filter: blur(16px);
      border: 0px solid rgba(139, 92, 246, 0.3);
      padding: clamp(10px, 2vh, 14px) clamp(8px, 1.5vw, 12px);
      border-radius: clamp(10px, 5vw, 30px);
      text-align: center;
      font-weight: 600;
      font-size: clamp(18px, 3vw, 22px);
      cursor: pointer;
      transition: .18s;
      color: white;
      min-height: clamp(45px, 8vh, 60px);
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .option:hover {
      transform: translateY(-2px);
      border-color: rgba(139, 92, 246, 0.6);
      background: #1c1c1e;
    }

 .overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(10, 10, 30, 0.9);
      backdrop-filter: blur(8px);
      align-items: center;
      justify-content: center;
      z-index: 1000;
    }

    .overlay.active { display: flex; }

    .congrats {
      padding: clamp(20px, 4vh, 30px);
      background: #000000bf;
      backdrop-filter: blur(50px);
      border: 1px solid rgb(198 198 200 / 40%);
      box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
      border-radius: 20px;
      text-align: center;
      max-width: 90vw;
    }

    .congrats h2 {
      font-size: clamp(24px, 5vw, 36px);
      margin-bottom: 10px;
          color: white;
    }

    .congrats p {
      font-size: clamp(14px, 3vw, 18px);
      margin-bottom: 16px;
          color: white;
    }
    
    .button-group {
      display: flex;
      gap: 12px;
      justify-content: center;
      flex-wrap: wrap;
    }

    .action-btn {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 12px 24px;
      font-size: clamp(14px, 3vw, 16px);
      border: none;
      border-radius: 10px;
      cursor: pointer;
      transition: all 0.3s ease;
      font-weight: 500;
    }

    .btn-icon {
      width: 20px;
      height: 20px;
      object-fit: contain;
    }

    .home-btn {
      background: #005fcc;
      border-color: rgba(139, 92, 246, 0.5);
      color: #ffffff;
    }



    /* Landscape mobile optimization */
    @media (max-height: 500px) and (orientation: landscape) {
      .quiz-topbar {
        min-height: 35px;
      }
      
      .qa-card {
        flex-direction: row;
        gap: clamp(10px, 2vw, 16px);
      }

      .topPane {
        flex: 0 0 40%;
      }

      .animal-pic-wrap {
        max-height: 70vh;
        max-width: 100%;
      }

      .bottomPane {
        flex: 1;
      }

      .option {
        min-height: clamp(40px, 7vh, 50px);
        font-size: clamp(12px, 2.5vw, 16px);
      }
    }

    /* Large screen optimization */
    @media (min-width: 900px) {
      .animal-pic-wrap {
        max-width: 400px;
        max-height: 400px;
      }

      .options {
        max-width: 100%;
        margin: 0 auto;
      }
    }

    /* Extra small screens */
    @media (max-height: 600px) {
      .animal-pic-wrap {
        max-height: 25vh;
      }

      .q-text {
        font-size: clamp(20px, 3vw, 22px);
      }

      .option {
        min-height: clamp(40px, 7vh, 50px);
        padding: clamp(8px, 1.5vh, 10px);
      }
    }

    @keyframes shake {
      0% { transform: translateX(0); }
      25% { transform: translateX(-4px); }
      50% { transform: translateX(4px); }
      75% { transform: translateX(-4px); }
      100% { transform: translateX(0); }
    }

    /* ✅ Correct answer */
    .option.correct {
     
      background: #34C759 !important;
      box-shadow:
        0 0 0.5rem #10b981,
        0 0 1rem rgba(16, 185, 129, 0.48),
        0 0 0 4px rgba(16, 185, 129, 0.15) inset;
    }

    /* ❌ Wrong answer */
    .option.wrong {
      border-color: #ef4444 !important;
      background: rgba(239, 68, 68, 0.2) !important;
      box-shadow:
        0 0 0.6rem #ef4444,
        0 0 1.2rem rgba(239, 68, 68, 0.6),
        0 0 0 4px rgba(239, 68, 68, 0.25) inset;
      animation: shake 0.25s ease-in-out 2;
      position: relative;
    }

    /* ❌ Wrong icon */
    .option.wrong::after {
      content: "✕";
      position: absolute;
      right: 12px;
      top: 50%;
      transform: translateY(-50%);
      font-size: clamp(24px, 4vw, 32px);
      color: #ef4444;
      font-weight: 900;
      animation: wrongIconPop 0.3s ease-out;
    }

    @keyframes wrongIconPop {
      0% { 
        transform: translateY(-50%) scale(0);
        opacity: 0;
      }
      50% { 
        transform: translateY(-50%) scale(1.2);
      }
      100% { 
        transform: translateY(-50%) scale(1);
        opacity: 1;
      }
    }


     .audio-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: none;
    cursor: pointer;
    color: #ffffff;
    font-weight: 900;
    font-size: clamp(14px, 2.5vw, 16px);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.audio-btn img {
    width: 26px;
    height: 26px;
    filter: brightness(0) invert(1); /* makes icon white */
}

.audio-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.45);
}

.audio-btn:active {
    transform: scale(0.97);
}