/* Todo queda acotado a las clases activadas al iniciar Zoom en un dispositivo táctil. */
body.zoom-touch-session { overflow: hidden; }
.zoom-touch-grid > [data-player="0"] { --touch-color: var(--yellow); }
.zoom-touch-grid > [data-player="1"] { --touch-color: var(--blue); }
.zoom-touch-grid > [data-player="2"] { --touch-color: var(--orange); }
.zoom-touch-grid > [data-player="3"] { --touch-color: #b297ff; }
.zoom-touch-grid > [data-player="4"] { --touch-color: #68d6a5; }
.zoom-touch-grid > [data-player="5"] { --touch-color: #ee8db3; }
.zoom-touch-setup, .zoom-touch-game {
  position: fixed; z-index: 1000; inset: var(--zoom-touch-top, 0px) 0 auto;
  height: var(--zoom-touch-height, 100dvh); width: 100%; max-width: none; margin: 0;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  border: 0; border-radius: 0; box-shadow: none; background: var(--panel); overflow-y: auto; overscroll-behavior: contain;
}
.zoom-touch-setup:not(.hidden) { display: flex; flex-direction: column; gap: 10px; }
.zoom-touch-setup > :is(.panel-label, h2, p:not(#zoomBindingStatus), #zoomBindings, #zoomCancelBindingBtn) { display: none; }
#zoomTouchPreview { display: flex; flex-direction: column; flex: 1; min-height: 160px; gap: 8px; }
#zoomTouchPreview h2 { font-size: 22px; margin: 0; }
#zoomTouchPreview p { font-size: 14px; margin: 0; }
.zoom-touch-grid { display: grid; grid-template-columns: 1fr; grid-auto-rows: 1fr; flex: 1; min-height: 0; gap: 5px; }
.zoom-touch-grid > button { display: flex; align-items: center; justify-content: center; padding: 8px; overflow-wrap: anywhere; min-width: 0; border: 2px solid var(--touch-color, var(--muted)); background: transparent; color: var(--touch-color, var(--muted)); font-size: clamp(16px, 3.5vw, 24px); font-weight: 900; }
.zoom-touch-grid:is([data-count="4"], [data-count="5"], [data-count="6"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.zoom-touch-grid[data-count="5"] > :last-child { grid-column: 1 / -1; }
.zoom-touch-grid > button { width: 100%; height: 100%; min-height: 0; border-radius: 0; box-shadow: none; transform: none; letter-spacing: 0; font: inherit; font-weight: 900; }
.zoom-touch-grid > button::after { display: none; }
.zoom-touch-grid > button:disabled { opacity: 1; cursor: default; filter: none; }
.zoom-touch-grid > button:not([data-player]) { border-style: dashed; }
#zoomTouchReset { font-size: 12px; padding: 6px 10px; min-height: 36px; }

.zoom-touch-setup .actions, .zoom-touch-setup .zoom-menu-area { margin: 0; padding: 0; border: 0; }
.zoom-touch-setup #zoomBindingStatus:empty { display: none; }
.zoom-touch-setup #zoomBindingStatus { margin: 0; min-height: 0; }
.zoom-touch-setup .actions button { width: 100%; min-height: 48px; }
.zoom-touch-game > :is(.panel-label, details) { display: none; }
.zoom-touch-game .zoom-heading h2 { font-size: 18px; margin: 0; }
.zoom-touch-game .zoom-heading p { font-size: 12px; margin: 0; }
.zoom-touch-game :is(#zoomScoreboard, #onlineZoomScoreboard) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 8px 0; }
.zoom-touch-game :is(#zoomScoreboard, #onlineZoomScoreboard) p { font-size: 11px; padding: 5px; }
.zoom-touch-game .zoom-layout { position: static; z-index: auto; display: flex; flex-direction: column; gap: 8px; }
.zoom-touch-game .zoom-controls { width: 100%; }
.zoom-touch-game .zoom-viewport { width: min(100%, 30vh); max-width: none; box-shadow: none; flex-shrink: 0; }
.zoom-touch-game .zoom-controls .status { min-height: 0; margin: 6px 0; font-size: 13px; }
.zoom-touch-game .zoom-controls .status:empty { display: none; }
.zoom-touch-game .zoom-value { margin: 5px 0; font-size: 14px; }
.zoom-touch-game .zoom-turn { margin: 8px 0; font-size: 18px; }
.zoom-touch-game .zoom-timer { font-size: 24px; }
.zoom-touch-game :is(#zoomAnswerForm, #onlineZoomAnswerForm) { margin: 8px 0; }
.zoom-touch-game :is(#zoomSearch, #multiZoomSearch) { font-size: 16px; }
.zoom-touch-game #zoomSearchHint { margin: 6px 0; }
.zoom-touch-game .zoom-menu-area { margin-top: 16px; padding-top: 8px; }
.zoom-touch-game :is(#zoomBuzzers, #onlineZoomBuzzers):not(.hidden) { display: none; }
.zoom-touch-game[data-touch-phase="answering"] { display: flex; flex-direction: column; overflow: hidden; }
.zoom-touch-game[data-touch-phase="answering"].hidden { display: none; }
.zoom-touch-game[data-touch-phase="answering"] .zoom-layout { flex: 1; min-height: 0; }
.zoom-touch-game[data-touch-phase="answering"] .zoom-viewport { align-self: center; width: clamp(84px, calc(var(--zoom-touch-height, 100dvh) * .28), 220px); }
.zoom-touch-game[data-touch-phase="answering"] .zoom-controls { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 3px 4px; }
.zoom-touch-game[data-touch-phase="answering"] .zoom-turn { display: inline-block; margin: 4px 0; font-size: 16px; }
.zoom-touch-game[data-touch-phase="answering"] .zoom-timer { float: right; margin: 4px 0; font-size: 18px; }
.zoom-touch-game[data-touch-phase="answering"] :is(#zoomAnswerForm, #onlineZoomAnswerForm) { clear: both; margin: 4px 0; }
.zoom-touch-game[data-touch-phase="answering"] :is(#zoomAnswerForm, #onlineZoomAnswerForm) label { margin-bottom: 4px; }
.zoom-touch-game[data-touch-phase="answering"] #zoomSearchHint { display: none; }
.zoom-touch-game[data-touch-phase="answering"] .zoom-menu-area { flex-shrink: 0; margin-top: 6px; padding-top: 4px; }
.zoom-touch-game[data-touch-phase="answering"] :is(.zoom-heading, :is(#zoomScoreboard, #onlineZoomScoreboard), #zoomAutoHintLabel, :is(#zoomLetterHint, #onlineZoomLetterHint)) { display: none; }
.zoom-touch-game[data-touch-phase="suspended"] .zoom-viewport { width: min(100%, 24vh); }
.zoom-touch-game .zoom-letter-hint { padding: 8px; margin: 8px 0; font-size: 20px; }
.zoom-touch-game .zoom-controls .actions { gap: 6px; margin: 8px 0; }
.zoom-touch-game .zoom-controls .actions button { min-height: 44px; padding: 8px; font-size: 12px; }
/* En juego: imagen detrás de las zonas; solo la franja de acciones queda excluida. */
.zoom-touch-game.zoom-touch-listening { overflow: hidden; }
.zoom-touch-listening .zoom-heading, .zoom-touch-listening :is(#zoomScoreboard, #onlineZoomScoreboard) { position: relative; z-index: 3; pointer-events: none; }
.zoom-touch-game.zoom-touch-listening :is(#zoomScoreboard, #onlineZoomScoreboard), .zoom-touch-game.zoom-touch-listening #zoomStatus { display: none; }
.zoom-touch-listening .zoom-viewport { position: absolute; top: calc((100% + var(--zoom-feedback-band) - var(--zoom-footer)) / 2); left: 50%; transform: translate(-50%, -50%); width: min(94vw, 66vh, max(48px, calc(var(--zoom-touch-height, 100dvh) - var(--zoom-footer) - var(--zoom-feedback-band)))); }
.zoom-touch-listening :is(#zoomBuzzers, #onlineZoomBuzzers):not(.hidden) { display: grid; position: absolute; inset: 0 0 var(--zoom-footer); z-index: 2; grid-template-columns: 1fr; grid-auto-rows: 1fr; gap: 0; }
.zoom-touch-listening :is(#zoomBuzzers, #onlineZoomBuzzers):is([data-count="4"], [data-count="5"], [data-count="6"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.zoom-touch-listening :is(#zoomBuzzers, #onlineZoomBuzzers)[data-count="5"] > :last-child { grid-column: 1 / -1; }
.zoom-touch-listening :is(#zoomBuzzers, #onlineZoomBuzzers) > div { position: relative; min-height: 0; min-width: 0; }
.zoom-touch-listening :is(#zoomBuzzers, #onlineZoomBuzzers) button { height: 100%; min-height: 0; border: 1px solid var(--zoom-player-color); border-radius: 0; box-shadow: none; transform: none; background: transparent; color: var(--zoom-player-color); display: flex; align-items: flex-end; justify-content: flex-start; padding: 12px; text-align: left; font-size: 14px; letter-spacing: 0; overflow-wrap: anywhere; text-shadow: 0 1px 3px #000, 0 0 6px #000; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.zoom-touch-listening :is(#zoomBuzzers, #onlineZoomBuzzers) button::after { display: none; }
.zoom-touch-listening :is(#zoomBuzzers, #onlineZoomBuzzers) button:disabled { opacity: .5; background: transparent; }
.zoom-touch-listening :is(#zoomBuzzers, #onlineZoomBuzzers) .zoom-buzzer-binding { display: none; }
/* Reserve room for recovery in each outer corner, beside the name and score. */
.zoom-touch-listening :is(#zoomBuzzers, #onlineZoomBuzzers) .zoom-stun-slot {
  pointer-events: none;
  position: absolute;
  inset: auto auto 8px 8px;
  width: 22px;
  height: 22px;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
}
.zoom-touch-listening :is(#zoomBuzzers, #onlineZoomBuzzers):is([data-count="4"], [data-count="5"], [data-count="6"])
  > :nth-child(even) .zoom-stun-slot { left: auto; right: 8px; }
.zoom-touch-listening :is(#zoomBuzzers, #onlineZoomBuzzers) .zoom-stun-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.zoom-touch-listening :is(#zoomBuzzers, #onlineZoomBuzzers) .zoom-stun-track {
  width: 100%;
  height: 100%;
  margin: 0;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: conic-gradient(var(--zoom-player-color) calc(100% - var(--zoom-recovery, 0%)), var(--panel-2) 0);
}
.zoom-touch-listening :is(#zoomBuzzers, #onlineZoomBuzzers) .zoom-stun-fill { visibility: hidden; }
.zoom-touch-listening :is(#zoomBuzzers, #onlineZoomBuzzers) .zoom-stunned button:disabled {
  background: transparent;
  border-color: var(--zoom-player-color);
  opacity: 1;
}
.zoom-touch-listening #zoomStatus, .zoom-touch-listening :is(#zoomLetterHint, #onlineZoomLetterHint) { position: relative; z-index: 3; pointer-events: none; width: fit-content; max-width: 100%; background: #15171de6; padding: 5px; }
.zoom-touch-listening #zoomAutoHintLabel { display: none; }
.zoom-touch-listening .zoom-controls > .actions:has(#zoomResumeBtn) { position: absolute; bottom: max(8px, env(safe-area-inset-bottom)); left: 12px; right: 12px; z-index: 4; margin: 0; }
.zoom-touch-listening .zoom-menu-area { display: none; }
@media (orientation: landscape) {
  .zoom-touch-game[data-touch-phase="answering"] .zoom-layout { flex-direction: row; align-items: stretch; }
  .zoom-touch-game[data-touch-phase="answering"] .zoom-viewport { width: min(30vw, calc(var(--zoom-touch-height, 100dvh) - 80px)); margin: auto 8px auto 0; }
  .zoom-touch-listening .zoom-viewport { width: min(65vw, 78vh, max(48px, calc(var(--zoom-touch-height, 100dvh) - var(--zoom-footer) - var(--zoom-feedback-band)))); }
  .zoom-touch-listening :is(#zoomLetterHint, #onlineZoomLetterHint) { position: absolute; bottom: var(--zoom-footer); right: 12px; max-width: 60%; margin: 0; padding: 6px; font-size: 16px; text-align: center; }
  .zoom-touch-listening :is(#zoomScoreboard, #onlineZoomScoreboard) { max-width: 45%; }
  .zoom-touch-listening #zoomStatus { max-width: 42%; }
  .zoom-touch-listening :is(#zoomBuzzers, #onlineZoomBuzzers) button { font-size: 13px; padding-block: 6px; }
}


/* Reserve a separate feedback band so guesses never cover the portrait. */
.zoom-touch-game .zoom-shared-feedback, .zoom-touch-game .zoom-attempts-host { position: relative; z-index: 4; flex-shrink: 0; }
.zoom-touch-listening :is(.zoom-shared-feedback,.zoom-attempts-host) {
  position: absolute;
  inset: var(--zoom-feedback-top) 12px auto;
  max-height: calc(var(--zoom-feedback-band) - var(--zoom-feedback-top) - 4px);
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: none;
}
.zoom-touch-listening .zoom-shared-feedback { display:flex; flex-direction:column; }
.zoom-touch-listening .zoom-attempts { pointer-events:auto; }
.zoom-touch-listening .zoom-player-statuses { pointer-events:auto; }
.zoom-touch-listening .zoom-attempts ul { max-height: 27px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.zoom-touch-listening .zoom-attempts li { flex: none; max-width: none; white-space: nowrap; }

.zoom-touch-game .zoom-attempts { padding: 5px 6px; margin: 4px 0; background: #15171de6; }
.zoom-touch-game .zoom-attempts h3 { font-size: 10px; margin-bottom: 3px; }
.zoom-touch-game .zoom-attempts ul { max-height: 52px; }
.zoom-touch-game .zoom-attempts li { font-size: 10px; padding: 2px 4px; }

/* Preserve transparent zones and their assigned positions with compact labels. */
.zoom-touch-game .zoom-round, .zoom-touch-game #zoomRound { font-size: 20px; margin: 6px 0 10px; text-align: center; }
.zoom-touch-game .zoom-reward-number { font-size: 26px; }
/* The round image starts below the shared scoreboard and previous guesses. */
.zoom-mobile-scores { display: none; }
.zoom-touch-listening :is(#zoomBuzzers, #onlineZoomBuzzers) .zoom-buzzer-content { display: none; }
.zoom-touch-game .zoom-player-status[data-player="0"] { --zoom-player-color: var(--yellow); }
.zoom-touch-game .zoom-player-status[data-player="1"] { --zoom-player-color: var(--blue); }
.zoom-touch-game .zoom-player-status[data-player="2"] { --zoom-player-color: var(--orange); }
.zoom-touch-game .zoom-player-status[data-player="3"] { --zoom-player-color: #b297ff; }
.zoom-touch-game .zoom-player-status[data-player="4"] { --zoom-player-color: #68d6a5; }
.zoom-touch-game .zoom-player-status[data-player="5"] { --zoom-player-color: #ee8db3; }
.zoom-touch-game .zoom-player-status { color: var(--zoom-player-color); }
.zoom-touch-listening .zoom-player-statuses { margin: 0; }
.zoom-touch-listening .zoom-player-status { padding: 3px 5px; }
.zoom-touch-listening .zoom-status-score { font-size: 13px; font-variant-numeric: tabular-nums; }
.zoom-touch-listening .zoom-status-heading { line-height: 16px; }
.zoom-touch-listening .zoom-player-status .zoom-stun { display: none; }
.zoom-touch-listening .zoom-player-status.zoom-stunned:not([data-local-buzzer]) .zoom-status-score::before {
  content: "";
  display: inline-block;
  vertical-align: 1px;
  width: 9px;
  aspect-ratio: 1;
  margin-right: 4px;
  border-radius: 50%;
  background: conic-gradient(currentColor calc(100% - var(--zoom-recovery, 0%)), var(--line) 0);
}
#zoomGame.zoom-touch-listening .zoom-mobile-scores { display: grid; pointer-events: none; }
.zoom-touch-listening .zoom-attempts { order: 1; }

.zoom-touch-game.zoom-touch-listening {
  --zoom-footer: calc(64px + env(safe-area-inset-bottom, 0px));
  --zoom-feedback-top: max(90px, calc(env(safe-area-inset-top) + 81px));
  --zoom-score-band: 56px;
  --zoom-feedback-band: calc(var(--zoom-feedback-top) + var(--zoom-score-band));
}
.zoom-touch-game.zoom-touch-listening:has(.zoom-attempts:not(.hidden)) {
  --zoom-feedback-band: calc(var(--zoom-feedback-top) + var(--zoom-score-band) + 52px);
}
#zoomGame.zoom-touch-listening .zoom-mobile-scores,
#zoomGame.zoom-touch-listening .zoom-attempts-host {
  position: absolute;
  inset: var(--zoom-feedback-top) 12px auto;
}
#zoomGame.zoom-touch-listening .zoom-attempts-host {
  top: calc(var(--zoom-feedback-top) + var(--zoom-score-band));
  max-height: 48px;
}
.zoom-touch-listening .zoom-value {
  position: absolute;
  z-index: 4;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  margin: 0;
  padding: 4px 8px;
  max-width: 39%;
  background: #15171d;
  font-size: 12px;
  line-height: 1.2;
  text-align: right;
  pointer-events: none;
}
.zoom-touch-listening .zoom-value > span:first-child { display: none; }
.zoom-touch-listening .zoom-value .zoom-reward-number { font-size: 20px; }
#onlinePlay.zoom-touch-listening .multi-zoom-actions { right: 43%; }

#zoomGame.zoom-touch-listening .zoom-heading h2 { padding-right: min(45vw, 155px); }
#zoomGame.zoom-touch-listening #zoomRound { margin-top: 14px; }

/* Keep navigation outside the bottom action strip. */
#zoomGame.zoom-touch-listening > .zoom-menu-area {
  display: block; position: absolute; z-index: 4;
  top: max(8px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
  margin: 0; padding: 0; border: 0;
}
@media (orientation: landscape) {
  #zoomGame.zoom-touch-listening #zoomLetterHint { max-width: calc(100% - 180px); }
}

/* Keep the centered preview modest when the keyboard leaves little space. */
.zoom-touch-game.zoom-touch-answer-entry {
  --zoom-answer-height: var(--zoom-touch-height, 100dvh);
  --zoom-answer-image: clamp(32px, min(calc(var(--zoom-answer-height) * .37), calc(var(--zoom-answer-height) - 158px)), min(168px, calc(100vw - 152px)));
  padding-block: max(6px, env(safe-area-inset-top)) 4px;
}
.zoom-touch-game.zoom-touch-answer-entry > :not(.zoom-layout) { display: none; }
.zoom-touch-game.zoom-touch-answer-entry .zoom-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,var(--zoom-answer-image)) minmax(0,1fr);
  grid-template-rows: minmax(60px, var(--zoom-answer-image)) minmax(0, 1fr);
  gap: 4px;
  align-items: center;
}
.zoom-touch-game.zoom-touch-answer-entry .zoom-viewport {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  width: 100%;
  margin: 0;
}
.zoom-touch-game.zoom-touch-answer-entry .zoom-controls { display: contents; }
.zoom-touch-game.zoom-touch-answer-entry
  .zoom-controls > :not(.zoom-value, .zoom-timer, #zoomAnswerForm, #onlineZoomAnswerForm) { display: none; }
.zoom-touch-game.zoom-touch-answer-entry .zoom-timer {
  --zoom-timer-size: min(60px, 100%);
  grid-column: 3;
  grid-row: 1;
  justify-self: center;
  width: var(--zoom-timer-size);
  height: auto;
  aspect-ratio: 1;
  margin: 0;
  font-size: clamp(11px, 3.8vw, 16px);
  line-height: 1.2;
  color: var(--yellow);
}
.zoom-touch-game.zoom-touch-answer-entry .zoom-value {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  margin: 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.2;
}
.zoom-touch-game.zoom-touch-answer-entry .zoom-value > span:first-child { display: none; }
.zoom-touch-game.zoom-touch-answer-entry .zoom-reward-number { font-size: 20px; }
.zoom-touch-game.zoom-touch-answer-entry
  :is(#zoomAnswerForm, #onlineZoomAnswerForm) {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  padding-inline: 3px;
}
.zoom-touch-game.zoom-touch-answer-entry
  :is(#zoomAnswerForm, #onlineZoomAnswerForm) label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.zoom-touch-game.zoom-touch-answer-entry
  :is(#zoomSearch, #multiZoomSearch) { flex: none; padding: 8px 10px; }
.zoom-touch-game.zoom-touch-answer-entry .zoom-suggestions {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  align-content: start;
  margin: 4px 0 0;
}
.zoom-touch-game.zoom-touch-answer-entry #zoomSearchStatus { margin: 0; }
.zoom-touch-game.zoom-touch-answer-entry #zoomAnswerForm:has(.zoom-suggestions > li) #zoomSearchStatus {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
