.input-bar {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  border: 1.5px solid var(--border-main);
  border-radius: var(--radius);
  background: var(--block-bg);
  box-shadow: 0 2px 10px #0003;
  margin-bottom: 0;
  min-width: 0;
  width: 100%;
  overflow-x: auto;
  gap: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* ------------- CAMBIO CLAVE AQUÃ --------------- */
.input-bar input[type="text"], #user-input {
  flex: 1 1 0;
  min-width: 0;
  width: 1%;
  font-size: 1.2rem;
  padding: 15px 16px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-main);
  transition: background 0.18s;
  border-radius: 0;
  margin: 0;
  /* QUITA cualquier max-width aquÃ­ */
}
.input-bar input[type="text"]:focus, #user-input:focus {
  outline: none;
  background: #21222a;
}

/* Botones grandes pero alineados */
.input-bar button {
  min-width: 44px;
  max-width: 54px;
  flex: 0 0 48px;
  font-size: 1.5rem;     /* TamaÃ±o icono grande */
  margin: 0 0 0 2px;
  background: #16181b;
  color: #e6e6e6;
  border: none;
  padding: 13px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 0;
  transition: background .16s, color .16s;
  border-right: 1.2px solid var(--border-main);
}
.input-bar button:last-child { border-right: none; }
.input-bar button:disabled { opacity: 0.37; cursor: not-allowed; }
.input-bar button:hover:enabled, .input-bar button:focus:enabled {
  background: var(--accent);
  color: #fff;
}
.input-bar .material-icons {
  font-size: 1.35em !important;
  margin: 0;
  line-height: 1;
}

.input-bar.full-chat-style {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  position: relative;
  padding: 8px;
  border: 1.5px solid var(--border-main);
  border-radius: var(--radius);
  background: var(--block-bg);
  box-shadow: 0 2px 10px #0003;
}

.full-chat-style textarea#user-input {
  flex: 1;
  font-size: 1.2rem;
  padding: 12px 14px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-main);
  resize: none;
  overflow-y: auto;
  border-radius: var(--radius);
  line-height: 1.4;
  min-height: 38px;
  max-height: 120px;
}

.full-chat-style textarea#user-input:focus {
  outline: none;
  background: #21222a;
}

/* Botones dentro del input */
.input-actions {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-left: 8px;
}

.input-actions button {
  background: #16181b;
  color: #e6e6e6;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  min-width: 44px;
  height: 44px;
}

.input-actions button:hover:enabled {
  background: var(--accent);
  color: #fff;
}

#check-answer span.material-icons { color: #19c13e !important; }      /* verde */
#hint-button  span.material-icons { color: #ffe600 !important; }      /* amarillo brillante */
#replay-button span.material-icons { color: #fff !important; }        /* blanco */
#start-button span.material-icons { color: #09f2ff !important; filter: drop-shadow(0 0 7px #09f2ff88);}
#start-button {
  background: linear-gradient(100deg, #1434e2 55%, #3ef1ff 120%);
  color: #fff !important;
  border: 2px solid #0cf2ff;
  box-shadow: 0 0 18px 0 #09f2ff44;
  animation: pulse-blue 1.25s infinite alternate;
}

@keyframes pulse-blue {
  0%   { box-shadow: 0 0 12px #09f2ff66, 0 0 14px #1434e288; }
  100% { box-shadow: 0 0 32px #2ad3fc, 0 0 24px #2838f088; }
}
.material-icons {
  font-size: 1.13em !important; /* mÃ¡s pequeÃ±os */
  vertical-align: middle;
  line-height: 1;
}
.block-title {
  font-weight: 700;
  font-size: 1.7rem;
  text-align: left;
  letter-spacing: 0.01em;
  margin: 28px 0 18px 10px;
  color: var(--text-main);
  text-shadow: 0 2px 8px #0007;
}

/* Video Container */
.embed-container {
  position: relative;
  width: 92%;
  max-width: 720px;
  margin: 0 auto 20px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #000;
  aspect-ratio: 16/9;
  min-height: 180px;
}
#video-frame, .embed-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #111;
  z-index: 1;
}
.video-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: transparent;
  pointer-events: all;
  touch-action: none;
  cursor: not-allowed;
  z-index: 99;
}

/* Subtitle */
#current-subtitle {
  font-size: 1.17rem;
  text-align: center;
  margin: 13px auto 4px;
  color: var(--text-main);
  background: var(--block-bg);
  border-radius: var(--radius);
  padding: 8px 18px;
  max-width: 650px;
  box-shadow: 0 2px 8px #0004;
  border: 1px solid var(--border-main);
  font-weight: 500;
}

/* Exercise Controls */
.exercise-controls {
  max-width: 680px;
  margin: 18px auto 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* SCROLL AQUI */
  max-height: 65vh;  /* O ajusta segÃºn tu preferencia */
  overflow-y: auto;
  padding-bottom: 8px;
  scroll-behavior: smooth;
}

/* Feedback & Hints */
.scroll-box, #feedback-output, #hint-output {
  width: 100%;
  max-width: 680px;
  min-height: 46px;
  margin: 0 auto 6px;
  padding: 13px 16px;
  border-radius: var(--radius);
  background: #222224;
  font-size: 1.01rem;
  font-family: var(--font-main);
  box-shadow: 0 2px 6px #0003;
  border: 1px solid var(--border-main);
  text-align: left;
  color: var(--text-dim);
}
#feedback-output,
#hint-output {
  min-height: 38px;
  max-height: none;
  overflow-y: visible;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: var(--radius);
  padding: 7px 15px 7px 8px;
  scroll-behavior: auto;
  position: relative;
}

.easy-partial {
  margin-top: 8px;
  text-align: left;
  display: block;
  background: #19356a40;
  border-radius: 10px;
  padding: 7px 10px;
  overflow: visible;
  max-width: 100%;
  font-size: 1em;
  color: #44bbff;
}

.easy-word-chip {
  background: #1e5c95;
  color: #d0eeff;
  border-radius: 11px;
  padding: 3px 10px 4px 10px;
  margin-right: 6px;
  font-weight: 600;
  font-family: var(--font-main);
  display: inline-block;
  font-size: 1em;
}
.easy-letter.revealed {
  color: #fff;
  font-weight: bold;
}
.easy-letter.hidden {
  color: #4a81b6;
}
.word-chip {
  display: inline-block;
  padding: 0.32em 0.85em;
  margin: 0 0.18em 0.48em 0;
  border-radius: 9px;
  font-size: 1.13em;
  font-weight: 500;
  background: #191a1f;
  color: #fff;
  border: 1.5px solid #333;
  min-width: 2em;
  text-align: center;
  letter-spacing: 0.03em;
  transition: background 0.22s;
}
.word-chip.green    { background: #23c063; color: #fff; border-color: #23c063; }
.word-chip.blue     { background: #2186f2; color: #fff; border-color: #2186f2; }
.word-chip.yellow   { background: #ffaa00; color: #222; border-color: #ffe072; }
.word-chip.black    { background: #222; color: #fff; border-color: #444; }
.word-chip.reveal   { letter-spacing: 0.17em; font-family: monospace; }

/* Scrollbars mÃ¡s visibles */
#feedback-output::-webkit-scrollbar,
#hint-output::-webkit-scrollbar {
  width: 7px;
  background: var(--scrollbar-bg);
}
#feedback-output::-webkit-scrollbar-thumb,
#hint-output::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 6px;
}
#hint-output {
  color: #fff;
  font-style: normal;
  min-height: 44px;
  background: #232327;
  border: 1.2px solid #444;
  border-radius: 14px;
  padding: 8px 12px;
  max-height: 110px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 8px;
  align-items: flex-start;
  flex-direction: row;
  scroll-behavior: smooth;
}

/* Hint chips mejor visibles */
.hint-chip {
  display: inline-block;
  background: #191a1f;
  color: #f0ca43;
  border-radius: 13px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 1.07rem;
  box-shadow: 0 2px 6px #0003;
  margin-bottom: 4px;
  margin-right: 4px;
  border: 1.5px solid #484848;
  white-space: pre-line;
  transition: background 0.14s;
}
.hint-chip.no-more {
  background: #343434;
  color: #bbb;
  font-size: 0.99em;
}
/* Video Controls */
.video-controls-bar {
  display: flex;
  gap: 13px;
  justify-content: center;
  align-items: center;
  margin: 14px 0 10px 0;
  background: transparent;
}
.video-controls-bar .f7-button {
  background: #232327;
  color: #fff;
  border-radius: 12px;
  padding: 8px 13px;
  border: none;
  box-shadow: none;
  font-size: 1rem;
  display: flex;
  align-items: center;
  transition: background .14s;
}
.video-controls-bar .f7-button:hover,
.video-controls-bar .f7-button:active {
  background: #d7263d;
  color: #fff;
}
.video-controls-bar .material-icons {
  margin-right: 2px;
  font-size: 22px;
  vertical-align: middle;
}
.video-toolbar, .toolbar, .catalogo-header {
  padding-bottom: env(safe-area-inset-bottom, 0);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: envf(safe-area-inset-right, 0);
}

/* Video Header */
.video-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--block-bg, #18181a);  /* <--- Este background se aplica a todo el header, safe-area incluida */
  min-height: 48px;
  padding-top: env(safe-area-inset-top, 0);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  z-index: 1000;
}
.video-header {
  background: #23242d !important;
}
.video-back-btn {
  background: none;
  border: none;
  max-width:20%;
  color: #fff;
  cursor: pointer;
  padding: 7px 10px;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  border-radius: 12px;
  transition: background .17s;
  margin-left: 10px;
  min-width: 20px;
  z-index: 2;
}
.video-header-title {
  position: absolute;
  left: 0; right: 0; margin: 0 auto;
  text-align: center;
  font-weight: 700;
  font-size: clamp(1rem, 4vw, 1.35rem);
  color: #fff;
  letter-spacing: 0.01em;
  padding: 0 32px;
  max-width: 70vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 1;
  pointer-events: none;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-header-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 12px;
  margin-right: 12px;
  min-width: 42px;
  z-index: 2;
  background: none;
  display: block;
}
.sabiasque-popup {
  padding: 10px;
  font-size: 16px;
  line-height: 1.5;
  color: #333;
  overflow-y:scroll;
}

/* Scrollbar oscuro */
.scroll-box::-webkit-scrollbar,
.catalogo-horizontal-scroll::-webkit-scrollbar {
  height: 7px;
  background: var(--scrollbar-bg);
}
.scroll-box::-webkit-scrollbar-thumb,
.catalogo-horizontal-scroll::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 8px;
}

/* --- Responsive --- */
.input-bar {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  border: 1.5px solid var(--border-main);
  border-radius: var(--radius);
  background: var(--block-bg);
  box-shadow: 0 2px 10px #0003;
  margin-bottom: 0;
  min-width: 0;
  width: 100%;
  overflow-x: auto;
  gap: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* ------------- CAMBIO CLAVE AQUÃ --------------- */
.input-bar input[type="text"], #user-input {
  flex: 1 1 0;
  min-width: 0;
  width: 1%;
  font-size: 1.2rem;
  padding: 15px 16px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-main);
  transition: background 0.18s;
  border-radius: 0;
  margin: 0;
  /* QUITA cualquier max-width aquÃ­ */
}

.input-bar textarea#user-input {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  font-size: 1.2rem;
  padding: 15px 16px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-main);
  transition: background 0.18s;
  resize: none;
  overflow-y: auto;
  border-radius: 0;
  margin: 0;
  line-height: 1.4;
  min-height: 2.5em;
  max-height: 6.5em;
}

.input-bar textarea#user-input:focus {
  outline: none;
  background: #21222a;
}

@media (max-width: 800px) {
  .input-bar input[type="text"], #user-input { font-size: 1.07rem; padding: 12px 10px; }
}
@media (max-width: 650px) {
  .input-bar.full-chat-style,
  .input-bar { flex-direction: column; align-items: stretch; gap: 3px;}
  .input-actions { margin-left: 0; justify-content: flex-end;}
  .full-chat-style textarea#user-input { min-height: 2.2em; font-size: 1.05rem; }
}
/* ----------------------------------------------- */

@media (max-width: 450px) {
  .input-bar { border-radius: 10px; }
  .input-bar input[type="text"], #user-input { font-size: 0.93rem; }
  .block-title { font-size: 1.01rem; }
}
@media (max-width: 600px) {
  .block-title { font-size: 1.15rem; }
  .input-bar { font-size: 0.92rem; }
  #current-subtitle { font-size: 0.95rem; }
  .scroll-box { font-size: 0.93rem; padding: 8px 6px; }
  .video-header-title { font-size: 1.02rem; }
  .video-header-logo { height: 28px; width: 28px; }
  .video-header { height: 42px; }
}
@media (max-width: 500px) {
  .input-bar input[type="text"], #user-input { font-size: 0.96rem; }
  .input-bar button { min-width: 38px; max-width: 42px; font-size: 1.08rem; }
  #start-button { min-width: 39px; max-width: 44px; font-size: 1.1em;}
}
  @media (max-width: 480px) {
    .input-bar input[type="text"], #user-input { font-size: 0.90rem; }
    .input-bar button { font-size: 0.82rem; }
  }
@media (max-width: 450px) {
  .video-header-title {
    font-size: clamp(0.93rem, 4vw, 1.12rem);
    max-width: 58vw;
    padding: 0 16px;
  }
}
@media (max-width: 700px) {
  .input-bar { min-width: 0; }
  .input-bar input[type="text"], #user-input { font-size: 0.95rem; }
  .input-bar button { font-size: 0.88rem; min-width: 27px; max-width: 32px; padding: 7px 0; }
}