:root {
    --red: #d42426;
    --green: #0c5e31;
    --yellow: #ffde59;
    --white: #f9f9f9;
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial Rounded MT Bold', Arial, sans-serif;
  }
  
  body {
    background: var(--green);
    color: var(--white);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    touch-action: none;
  }
  
  /* --- Header --- */
  header {
    text-align: center;
    padding: 10px 0;
  }
  
  h1 {
    color: var(--yellow);
    font-size: 1.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
  }
  
  .elf-hat {
    width: 28px;
  }
  
  /* --- Cámara --- */
  #camera-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 3px dashed var(--yellow);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    max-height: 60vh; /* 🔹 limita la altura total */
  }
  
  #camera-view-container {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 3 / 4; /* 🔹 mantiene forma vertical */
    position: relative;
  }
  
  #camera-view,
  #camera-output {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
  }
  
  /* --- Traducción --- */
  #translation-area {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 10px;
    background: rgba(12, 94, 49, 0.85);
    border-top: 2px solid var(--yellow);
    text-align: center;
  }
  
  #translated-text {
    font-size: 1.1rem;
    color: var(--yellow);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  }
  
  /* --- Botones --- */
  .button-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
  }
  
  .main-button {
    padding: 12px 22px;
    font-size: 1rem;
    background: var(--red);
    color: var(--white);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: 0.3s;
  }
  
  .main-button:hover {
    background: #b81d1f;
  }
  
  /* --- Botón engranaje --- */
  .engine-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--yellow);
    color: var(--green);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.9;
    z-index: 10;
  }
  
  /* --- Modal --- */
  .modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
  }
  
  .modal-content {
    background: var(--green);
    border: 2px solid var(--red);
    border-radius: 10px;
    padding: 15px;
    width: 90%;
    max-width: 350px;
  }
  
  .modal h2 {
    color: var(--yellow);
    text-align: center;
    margin-bottom: 10px;
  }
  
  #human-text {
    width: 100%;
    height: 100px;
    border: 2px solid var(--yellow);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 10px;
    resize: none;
  }
  
  /* --- Utilidades --- */
  .hidden {
    display: none !important;
  }
  
  /* --- Forzar orientación vertical --- */
/*   @media screen and (orientation: landscape) {
    body::before {
      content: "Please rotate your device 📱";
      position: fixed;
      inset: 0;
      background: var(--green);
      color: var(--yellow);
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 1.3rem;
      text-align: center;
      padding: 20px;
      z-index: 9999;
    }
  
    main, header, .button-container {
      display: none;
    }
  } */
  
  /* Fuerza a que el contenido se muestre siempre en vertical (portrait) */
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }
  
  .app-container {
    width: 100vw;
    height: 100vh;
    transform-origin: center center;
  }
  
  /* Si el dispositivo está en horizontal, rotamos todo el contenido para mantenerlo vertical */
  @media screen and (orientation: landscape) {
    .app-container {
      transform: rotate(-90deg);
      width: 100vh;
      height: 100vw;
    }
  }

  #translated-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 1rem;
    border-radius: 8px;
}

#thinking-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.2rem;
    gap: 1rem;
}

#thinking-overlay .gear {
    width: 50px;
    height: 50px;
    border: 6px solid #fff;
    border-top: 6px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Línea amarilla adaptada al tamaño de cámara --- */
#camera-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 4px dashed var(--yellow); /* más gruesa */
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    width: 90%;
    max-width: 420px;
    margin: 0 auto;
  }
  
  /* --- Título y subtítulo --- */
  h1 {
    font-size: 2.4rem;
    color: var(--yellow);
    margin-bottom: 6px;
  }
  
  h3 {
    font-size: 1.2rem;
    margin-top: 8px;
    color: var(--white);
    opacity: 0.9;
  }
  
  /* --- Botón hamburguesa --- */
  .menu-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--yellow);
    color: var(--green);
    border: none;
    border-radius: 8px;
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    z-index: 11;
  }
  
  /* --- Side Panel --- */
  .side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 75%;
    max-width: 280px;
    height: 100%;
    background: var(--green);
    border-left: 3px solid var(--yellow);
    box-shadow: -4px 0 10px rgba(0,0,0,0.5);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    animation: slideIn 0.3s ease forwards;
  }
  
  @keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
  }
  
  .side-panel-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    gap: 15px;
  }
  
  .side-btn {
    background: var(--yellow);
    color: var(--green);
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
  }
  
  .side-btn:hover {
    background: #f7d83b;
  }
  
  .ad-space {
    margin-top: auto;
    background: rgba(255,255,255,0.1);
    border: 1px dashed var(--yellow);
    border-radius: 8px;
    text-align: center;
    padding: 15px;
    color: var(--yellow);
    font-size: 0.9rem;
  }

  /* --- Botón hamburguesa arriba a la derecha --- */
.menu-button {
    position: fixed;
    top: 15px;
    right: 15px;
    background: var(--yellow);
    color: var(--green);
    border: none;
    border-radius: 8px;
    width: 45px;
    height: 45px;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    z-index: 11;
  }
  
  /* --- Side Panel --- */
  .side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 75%;
    max-width: 280px;
    height: 100%;
    background: var(--green);
    border-left: 3px solid var(--yellow);
    box-shadow: -4px 0 10px rgba(0,0,0,0.5);
    z-index: 100;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease forwards;
  }
  
  @keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
  }
  
  .side-panel-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    gap: 10px;
  }
  
  /* --- Acordeones --- */
  .accordion-content {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px;
    margin-top: -5px;
    color: var(--yellow);
    font-size: 0.95rem;
    text-align: left;
    transition: max-height 0.3s ease;
  }
  
  .accordion-toggle {
    width: 100%;
    text-align: left;
  }
  
  /* --- Footer con publicidad --- */
  footer {
    background: rgba(0, 0, 0, 0.2);
    border-top: 2px dashed var(--yellow);
    padding: 10px;
    text-align: center;
  }
  
  footer .ad-space {
    color: var(--yellow);
    font-size: 0.9rem;
    border: 1px dashed var(--yellow);
    border-radius: 8px;
    padding: 8px;
    background: rgba(255,255,255,0.05);
  }
  

  /* --- Asegura que el footer quede fijo al fondo --- */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border-top: 2px dashed var(--yellow);
    text-align: center;
    padding: 10px 0;
    z-index: 5;
  }
  
  /* --- Publicidad dentro del footer --- */
  footer .ad-space {
    color: var(--yellow);
    font-size: 0.9rem;
    border: 1px dashed var(--yellow);
    border-radius: 8px;
    padding: 8px;
    background: rgba(255,255,255,0.05);
    max-width: 90%;
    margin: 0 auto;
  }
  
  /* --- Deja espacio extra entre el último botón y el footer --- */
  .side-panel-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 90px; /* espacio para que no tape el anuncio */
  }
  