/* =========================================
   PopQuest Side Quest — Mobile-First QWERTY UI
   Scope: only the Side Quest native embed/teaser markup
   Goals:
   - No horizontal scroll
   - 2x2 clue grid on phones
   - Keyboard fits every device width
   - Sexy pill/card aesthetic consistent with PopQuest
   ========================================= */

.pq-native-embed--sidequest,
.pq-native-embed--sidequest * { box-sizing: border-box; }

.pq-native-embed--sidequest { width:100%; max-width:100%; overflow-x:clip; }

/* Base card */
.pq-native-embed--sidequest .pqs-wrap{
  width:100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px;
  border-radius: 22px;
  border: 2px solid #000;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0,0,0,.10);
  position: relative;
}

/* Title / sub */
.pq-native-embed--sidequest .pqs-title{
  font-weight: 1000;
  letter-spacing: -0.4px;
  font-size: clamp(26px, 6.2vw, 42px);
  line-height: 1.05;
  margin: 0;
}
.pq-native-embed--sidequest .pqs-sub{
  margin-top: 8px;
  font-size: 14px;
  font-weight: 800;
  opacity: .78;
}

/* Labels */
.pq-native-embed--sidequest .pqs-clues__label,
.pq-native-embed--sidequest .pqs-guess__label{
  margin-top: 14px;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: .6px;
  text-transform: uppercase;
  opacity: .85;
}

/* Clues box: 2x2 chips on mobile; 4 across on wider */
.pq-native-embed--sidequest .pqs-clues__box{
  margin-top: 10px;
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 560px){
  .pq-native-embed--sidequest .pqs-clues__box{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.pq-native-embed--sidequest .pqs-clues__box > * ,
.pq-native-embed--sidequest .pqs-clues__box:empty::before{
  content: attr(data-pq-placeholder);
}
.pq-native-embed--sidequest .pqs-clues__box:empty{
  min-height: 0;
}

/* For teaser, render “chips” using the dots as placeholders */
.pq-native-embed--sidequest .pqs-dots{
  margin-top: 10px;
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.pq-native-embed--sidequest .pqs-dots span{
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 16px;
  border: 2px solid #000;
  background: #91F88D;
  height: 54px;
  min-width: 0;
}
@media (max-width: 380px){
  .pq-native-embed--sidequest .pqs-dots span{ height: 50px; border-radius: 14px; }
}

/* Guess row */
.pq-native-embed--sidequest .pqs-guess__boxes{
  margin-top: 10px;
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.pq-native-embed--sidequest .pqs-guess__boxes span{
  height: 56px;
  border-radius: 16px;
  border: 2px solid rgba(0,0,0,.22);
  background:#fff;
  min-width:0;
}
@media (max-width: 380px){
  .pq-native-embed--sidequest .pqs-guess__boxes span{ height: 52px; border-radius: 14px; }
}

/* Keyboard: always fits, no fixed widths */
.pq-native-embed--sidequest .pqs-keys{
  margin-top: 12px;
  display:flex;
  flex-direction:column;
  gap: 8px;
  width:100%;
}
.pq-native-embed--sidequest .pqs-keys__row{
  display:flex;
  gap: 6px;
  width:100%;
}
.pq-native-embed--sidequest .pqs-keys__row span{
  flex: 1 1 0;
  min-width: 0;
  height: 46px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 14px;
  border: 2px solid rgba(0,0,0,.20);
  background:#f6f7fb;
  font-weight: 1000;
  font-size: 15px;
  color:#000;
}
@media (max-width: 380px){
  .pq-native-embed--sidequest .pqs-keys__row span{ height: 42px; font-size: 14px; border-radius: 12px; }
}

/* Actions */
.pq-native-embed--sidequest .pqs-actions{
  margin-top: 14px;
  display:flex;
  gap: 10px;
  align-items: stretch;
}
.pq-native-embed--sidequest .pqs-btn{
  flex: 1 1 0;
  border-radius: 999px;
  border: 2px solid #000;
  background:#fff;
  color:#000;
  font-weight: 1000;
  padding: 12px 14px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Ensure action buttons never get clipped */
.pq-native-embed--sidequest{ overflow: visible; }
.pq-native-embed--sidequest .pqs-wrap{ overflow: visible; }

/* Locked overlay gets nicer spacing on mobile */
.pq-native-embed--sidequest .pq-embed-locked__overlay{
  padding: 14px;
}



/* === QWERTY landing full-bleed fix (only when inside Game Landing Template) === */
body .pq-glBleed--qwerty .pq-native-embed--sidequest .pqs-wrap{
  max-width: 100% !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  border-radius: 0 !important;
}



/* === Bigger QWERTY keyboard (mobile enhancement) === */
@media (max-width: 768px){

  .pq-native-embed--sidequest .pqs-keys__row{
    gap: 8px;
  }

  .pq-native-embed--sidequest .pqs-key{
    height: 56px;
    min-height: 56px;
    font-size: 18px;
    border-radius: 14px;
  }

  .pq-native-embed--sidequest .pqs-key--wide{
    min-width: 64px;
  }

}



/* === Reveal Next Clue: dopamine tuning (mobile) === */
@media (max-width: 768px){

  /* Rebalance vertical rhythm after bigger keys */
  .pq-native-embed--sidequest .pqs-guess{ margin-bottom: 14px; }
  .pq-native-embed--sidequest .pqs-keys{ margin-top: 10px; }
  .pq-native-embed--sidequest .pqs-reveal{ margin-top: 16px; }

  /* Make the Reveal CTA feel “rewardy” without breaking B/W brand */
  .pq-native-embed--sidequest .pqs-reveal{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 2px solid #000;
    background: #fff;
    color: #000;
    font-weight: 1000;
    letter-spacing: -0.01em;
    text-transform: none;
    box-shadow: 0 10px 0 rgba(0,0,0,.14);
    transform: translateY(0);
    transition: transform .08s ease, box-shadow .08s ease, filter .18s ease;
    -webkit-tap-highlight-color: transparent;
  }

  /* Press feels juicy */
  .pq-native-embed--sidequest .pqs-reveal:active{
    transform: translateY(2px);
    box-shadow: 0 6px 0 rgba(0,0,0,.14);
  }

  /* Subtle “it’s ready” pulse when enabled */
  .pq-native-embed--sidequest .pqs-reveal:not([disabled]):not(.is-disabled){
    animation: pqRevealPulse 1.6s ease-in-out infinite;
  }

  /* If the plugin marks disabled via [disabled] or .is-disabled, calm it down */
  .pq-native-embed--sidequest .pqs-reveal[disabled],
  .pq-native-embed--sidequest .pqs-reveal.is-disabled{
    opacity: .55;
    box-shadow: none;
    animation: none;
  }

  /* Optional: add a tiny “spark” dot via ::after (no markup changes) */
  .pq-native-embed--sidequest .pqs-reveal:not([disabled]):not(.is-disabled)::after{
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #91F88D;
    margin-left: 10px;
    box-shadow: 0 0 10px rgba(145,248,141,.65);
    flex: 0 0 auto;
  }
}

@keyframes pqRevealPulse{
  0%, 100% { filter: drop-shadow(0 0 0 rgba(145,248,141,0)); }
  50%      { filter: drop-shadow(0 0 10px rgba(145,248,141,.45)); }
}

/* === v67 QWERTY archive/fullscreen repair === */
html.pq-qwerty-playing-html,
body.pq-qwerty-playing{
  overflow:hidden !important;
  overscroll-behavior:none !important;
}
body.pq-qwerty-playing .pq-side-quest[data-pq-fullscreen-active="1"]{
  position:fixed !important;
  inset:0 !important;
  z-index:2147483000 !important;
  width:100vw !important;
  height:100dvh !important;
  max-width:none !important;
  margin:0 !important;
  padding:clamp(10px,2vw,22px) !important;
  box-sizing:border-box !important;
  background:#fff !important;
  overflow:auto !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}
body.pq-qwerty-playing .pq-side-quest[data-pq-fullscreen-active="1"] .pq{
  width:min(1500px,100%) !important;
  max-width:none !important;
  margin:0 auto !important;
}
body.pq-qwerty-playing .pq-side-quest[data-pq-fullscreen-active="1"] .pq__header,
body.pq-qwerty-playing .pq-side-quest[data-pq-fullscreen-active="1"] .pq__welcomeTop{
  display:none !important;
}
body.pq-qwerty-playing .pq-side-quest[data-pq-fullscreen-active="1"] .pq__game,
body.pq-qwerty-playing .pq-side-quest[data-pq-fullscreen-active="1"] .pq__quiz{
  margin:0 !important;
  max-width:none !important;
}
@media (orientation:landscape) and (max-width: 950px){
  body.pq-qwerty-playing .pq-side-quest[data-pq-fullscreen-active="1"]{
    padding:8px env(safe-area-inset-right) 8px env(safe-area-inset-left) !important;
  }
  body.pq-qwerty-playing .pq-side-quest[data-pq-fullscreen-active="1"] .pq{
    transform-origin:center center;
  }
}
.pqQwertyArchiveMain .pqQwertyArchive--hub{padding-top:clamp(24px,4vw,58px)}
.pqQwertyArchiveGrid .pqDailyArchiveCard h2{font-size:clamp(32px,3.2vw,54px)!important;line-height:.9!important;letter-spacing:-.06em!important}
.pqQwertyArchiveGrid .pqDailyArchiveCard{overflow:hidden!important}

/* === v183.2 QWERTY mobile-landscape action row hard fix duplicate in qwerty asset === */
@media (max-width: 980px) and (orientation: landscape){
  body.pq-qwerty-route:not(.pq-qwerty-archive-route) .pq-side-quest .pq__kbd,
  body.pq-owned-qwerty-route:not(.pq-qwerty-archive-route) .pq-side-quest .pq__kbd,
  body.pq-qwerty-playing .pq-side-quest .pq__kbd{display:flex!important;flex-direction:column!important;align-items:stretch!important;overflow:visible!important;padding-bottom:0!important;}
  body.pq-qwerty-route:not(.pq-qwerty-archive-route) .pq-side-quest .pq__kbdKeys,
  body.pq-owned-qwerty-route:not(.pq-qwerty-archive-route) .pq-side-quest .pq__kbdKeys,
  body.pq-qwerty-playing .pq-side-quest .pq__kbdKeys{display:block!important;width:100%!important;position:relative!important;z-index:1!important;margin:0!important;padding:0!important;}
  body.pq-qwerty-route:not(.pq-qwerty-archive-route) .pq-side-quest .pq__kbdRow--actions,
  body.pq-owned-qwerty-route:not(.pq-qwerty-archive-route) .pq-side-quest .pq__kbdRow--actions,
  body.pq-qwerty-playing .pq-side-quest .pq__kbdRow--actions,
  body.pq-qwerty-route:not(.pq-qwerty-archive-route) .pq-side-quest .pq__kbdRow--actionsDetached,
  body.pq-owned-qwerty-route:not(.pq-qwerty-archive-route) .pq-side-quest .pq__kbdRow--actionsDetached,
  body.pq-qwerty-playing .pq-side-quest .pq__kbdRow--actionsDetached{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;width:min(520px,76vw)!important;max-width:520px!important;margin:10px auto 0!important;padding:0!important;flex:0 0 auto!important;position:static!important;inset:auto!important;transform:none!important;z-index:1!important;clear:both!important;pointer-events:auto!important;}
  body.pq-qwerty-route:not(.pq-qwerty-archive-route) .pq-side-quest .pq__kbdRow--actions .pq__key--action,
  body.pq-owned-qwerty-route:not(.pq-qwerty-archive-route) .pq-side-quest .pq__kbdRow--actions .pq__key--action,
  body.pq-qwerty-playing .pq-side-quest .pq__kbdRow--actions .pq__key--action,
  body.pq-qwerty-route:not(.pq-qwerty-archive-route) .pq-side-quest .pq__kbdRow--actionsDetached .pq__key--action,
  body.pq-owned-qwerty-route:not(.pq-qwerty-archive-route) .pq-side-quest .pq__kbdRow--actionsDetached .pq__key--action,
  body.pq-qwerty-playing .pq-side-quest .pq__kbdRow--actionsDetached .pq__key--action{display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;min-width:0!important;max-width:none!important;height:36px!important;min-height:36px!important;margin:0!important;padding:0 10px!important;position:static!important;inset:auto!important;transform:none!important;flex:1 1 auto!important;line-height:1!important;white-space:nowrap!important;font-size:12px!important;border-radius:999px!important;box-sizing:border-box!important;}
}

/* === V183.7 QWERTY landscape full-width keyboard duplicate override === */
@media (orientation: landscape) and (max-width: 980px){
  body[class*="qwerty"] .pqQwertyReplayKeys,
  body[class*="qwerty"] .pq-side-quest[data-pq-qwerty-shell="1"] .pq__kbdWrap{width:calc(100vw - max(20px, env(safe-area-inset-left, 0px)) - max(20px, env(safe-area-inset-right, 0px)))!important;max-width:1180px!important;margin-left:auto!important;margin-right:auto!important;box-sizing:border-box!important;}
  body[class*="qwerty"] .pqQwertyReplayKeys,
  body[class*="qwerty"] .pq-side-quest[data-pq-qwerty-shell="1"] .pq__kbd{padding:4px 6px calc(7px + env(safe-area-inset-bottom, 0px))!important;background:transparent!important;border:0!important;box-shadow:none!important;overflow:visible!important;}
  body[class*="qwerty"] .pqQwertyReplayKeyRow,
  body[class*="qwerty"] .pq-side-quest[data-pq-qwerty-shell="1"] .pq__kbdRow{width:100%!important;max-width:none!important;margin:0 auto 6px!important;gap:6px!important;display:grid!important;align-items:center!important;justify-content:stretch!important;grid-auto-flow:column!important;box-sizing:border-box!important;}
  body[class*="qwerty"] .pqQwertyReplayKeyRow:nth-child(1),
  body[class*="qwerty"] .pq-side-quest[data-pq-qwerty-shell="1"] .pq__kbdRow:nth-child(1){grid-template-columns:repeat(10,minmax(0,1fr))!important;}
  body[class*="qwerty"] .pqQwertyReplayKeyRow:nth-child(2),
  body[class*="qwerty"] .pq-side-quest[data-pq-qwerty-shell="1"] .pq__kbdRow:nth-child(2){width:90%!important;grid-template-columns:repeat(9,minmax(0,1fr))!important;}
  body[class*="qwerty"] .pqQwertyReplayKeyRow--actionsIntegrated,
  body[class*="qwerty"] .pq-side-quest[data-pq-qwerty-shell="1"] .pq__kbdRow--actionsIntegrated{width:100%!important;grid-template-columns:1.85fr repeat(8,minmax(0,1fr)) 1.85fr!important;}
  body[class*="qwerty"] .pqQwertyReplayKeyRow button,
  body[class*="qwerty"] .pqQwertyReplayKey,
  body[class*="qwerty"] .pqQwertyReplayActionKey,
  body[class*="qwerty"] .pq-side-quest[data-pq-qwerty-shell="1"] .pq__key,
  body[class*="qwerty"] .pq-side-quest[data-pq-qwerty-shell="1"] .pq__kbdRow--actionsIntegrated .pq__key--action{width:100%!important;max-width:none!important;min-width:0!important;height:clamp(36px,8.8vh,50px)!important;min-height:clamp(36px,8.8vh,50px)!important;padding:0 4px!important;border-radius:clamp(9px,1.8vh,13px)!important;font-size:clamp(14px,3.6vh,18px)!important;line-height:1!important;box-sizing:border-box!important;white-space:nowrap!important;box-shadow:0 clamp(3px,.9vh,5px) 0 #050505!important;}
  body[class*="qwerty"] .pqQwertyReplayKeyRow--actionsIntegrated .pqQwertyReplayActionKey,
  body[class*="qwerty"] .pq-side-quest[data-pq-qwerty-shell="1"] .pq__kbdRow--actionsIntegrated .pq__key--action{font-size:clamp(13px,3.3vh,17px)!important;font-weight:1000!important;background:#91F88D!important;color:#050505!important;border-color:#050505!important;box-shadow:0 clamp(3px,.9vh,5px) 0 #238a36!important;padding:0 8px!important;}
}
@media (orientation: landscape) and (max-width: 980px) and (max-height: 430px){
  body[class*="qwerty"] .pqQwertyReplayKeyRow,
  body[class*="qwerty"] .pq-side-quest[data-pq-qwerty-shell="1"] .pq__kbdRow{gap:5px!important;margin-bottom:5px!important;}
  body[class*="qwerty"] .pqQwertyReplayKeyRow button,
  body[class*="qwerty"] .pqQwertyReplayKey,
  body[class*="qwerty"] .pqQwertyReplayActionKey,
  body[class*="qwerty"] .pq-side-quest[data-pq-qwerty-shell="1"] .pq__key,
  body[class*="qwerty"] .pq-side-quest[data-pq-qwerty-shell="1"] .pq__kbdRow--actionsIntegrated .pq__key--action{height:34px!important;min-height:34px!important;font-size:13px!important;border-radius:8px!important;}
  body[class*="qwerty"] .pqQwertyReplayKeyRow--actionsIntegrated .pqQwertyReplayActionKey,
  body[class*="qwerty"] .pq-side-quest[data-pq-qwerty-shell="1"] .pq__kbdRow--actionsIntegrated .pq__key--action{font-size:12px!important;}
}

/* === v183.9 QWERTY landscape score/keyboard spacing fix duplicate === */
@media (orientation: landscape) and (max-width: 980px){
  body[class*="qwerty"] .pqQwertyReplayScore{
    position:relative!important;
    z-index:4!important;
    display:block!important;
    margin:0 auto 1px!important;
    min-height:0!important;
    font-size:clamp(18px,4.4vh,23px)!important;
    line-height:.95!important;
    text-align:center!important;
  }
  body[class*="qwerty"] .pqQwertyReplayStatus{
    position:relative!important;
    z-index:4!important;
    display:block!important;
    margin:0 auto 8px!important;
    min-height:0!important;
    font-size:clamp(12px,3.2vh,15px)!important;
    line-height:.95!important;
    text-align:center!important;
  }
  body[class*="qwerty"] .pqQwertyReplayKeys,
  body[class*="qwerty"] .pq-side-quest[data-pq-qwerty-shell="1"] .pq__kbd{
    transform:translateY(-4px)!important;
    margin-top:0!important;
  }
}
@media (orientation: landscape) and (max-width: 980px) and (max-height: 430px){
  body[class*="qwerty"] .pqQwertyReplayScore{font-size:clamp(16px,4vh,20px)!important;margin-bottom:0!important;}
  body[class*="qwerty"] .pqQwertyReplayStatus{font-size:clamp(10px,2.8vh,13px)!important;margin-bottom:6px!important;}
  body[class*="qwerty"] .pqQwertyReplayKeys,
  body[class*="qwerty"] .pq-side-quest[data-pq-qwerty-shell="1"] .pq__kbd{transform:translateY(-2px)!important;}
}


/* === v184 REAL QWERTY mobile landscape flex/layout fix ===
   Root cause: earlier mobile landscape rules left the score/status/keyboard layered
   in different stacking contexts. This final override makes the live QWERTY replay
   screen a single ordered flex column in landscape, hides the instructional status
   line while playing, and keeps the full-width Option 2 keyboard below the score. */
@media (orientation: landscape) and (max-width: 980px){
  body[class*="qwerty"] .pqQwertyReplayGame,
  body.pq-qwerty-archive-playing .pqQwertyReplayGame{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:100dvh!important;
    min-height:100dvh!important;
    max-height:100dvh!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:clamp(3px,.9vh,7px)!important;
    padding:calc(env(safe-area-inset-top,0px) + 4px) calc(env(safe-area-inset-right,0px) + 8px) calc(env(safe-area-inset-bottom,0px) + 6px) calc(env(safe-area-inset-left,0px) + 8px)!important;
    background:#fff!important;
  }

  body[class*="qwerty"] .pqQwertyReplayTop{
    order:1!important;
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    height:auto!important;
    min-height:14px!important;
    margin:0 auto!important;
    padding:0!important;
    display:block!important;
    text-align:center!important;
    line-height:1!important;
    z-index:3!important;
  }
  body[class*="qwerty"] .pqQwertyReplayTop strong{
    display:block!important;
    font-size:clamp(10px,2.2vw,13px)!important;
    line-height:1!important;
    letter-spacing:.12em!important;
    white-space:nowrap!important;
    opacity:.66!important;
  }

  body[class*="qwerty"] .pqQwertyReplayBoard{
    order:2!important;
    position:relative!important;
    z-index:2!important;
    width:100%!important;
    max-width:1120px!important;
    min-height:0!important;
    margin:0 auto!important;
    display:grid!important;
    grid-template-columns:minmax(118px,19vw) minmax(0,1fr)!important;
    align-items:center!important;
    justify-content:center!important;
    gap:clamp(8px,1.6vw,18px)!important;
    overflow:visible!important;
  }
  body[class*="qwerty"] .pqQwertyReplayBoard:not(.has-clue){
    grid-template-columns:minmax(118px,19vw) minmax(0,1fr)!important;
  }
  body[class*="qwerty"] .pqQwertyReplayClueRail,
  body[class*="qwerty"] .pqQwertyReplayClues{
    position:relative!important;
    order:initial!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    min-width:112px!important;
    max-width:210px!important;
    min-height:54px!important;
    max-height:78px!important;
    margin:0!important;
    padding:6px 8px!important;
    border:2px solid #050505!important;
    border-radius:14px!important;
    background:#fff!important;
    box-shadow:0 3px 0 #050505!important;
    overflow:hidden!important;
    visibility:visible!important;
    opacity:1!important;
  }
  body[class*="qwerty"] .pqQwertyReplayClues:not(.has-clue) [data-pq-qwerty-clue],
  body[class*="qwerty"] .pqQwertyReplayClues:not(.has-clue) .pqQwertyReplayClueViewport{
    visibility:hidden!important;
  }
  body[class*="qwerty"] .pqQwertyReplayClueRail small{
    position:absolute!important;
    top:6px!important;
    left:8px!important;
    font-size:8px!important;
    line-height:1!important;
    margin:0!important;
    padding:0!important;
    letter-spacing:.08em!important;
  }
  body[class*="qwerty"] .pqQwertyReplayClueViewport{width:100%!important;display:grid!important;grid-template-columns:18px minmax(0,1fr) 18px!important;gap:3px!important;align-items:center!important;}
  body[class*="qwerty"] .pqQwertyReplayClueNav{width:18px!important;height:18px!important;min-width:18px!important;min-height:18px!important;font-size:14px!important;box-shadow:none!important;}
  body[class*="qwerty"] .pqQwertyReplayClueChip,
  body[class*="qwerty"] .pqQwertyReplayClues div{
    font-size:clamp(10px,2vw,13px)!important;
    line-height:1.02!important;
    font-weight:950!important;
    white-space:normal!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  body[class*="qwerty"] .pqQwertyReplayAnswer{
    width:100%!important;
    max-width:100%!important;
    min-height:0!important;
    margin:0!important;
    gap:clamp(3px,.75vh,6px)!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    overflow:visible!important;
  }
  body[class*="qwerty"] .pqQwertyReplayWord{gap:clamp(4px,.8vw,8px)!important;justify-content:center!important;}
  body[class*="qwerty"] .pqQwertyReplayTile{
    width:clamp(35px,5.9vw,54px)!important;
    height:clamp(35px,5.9vw,54px)!important;
    min-width:0!important;
    min-height:0!important;
    border-radius:clamp(8px,1.6vh,12px)!important;
    font-size:clamp(18px,3.6vw,30px)!important;
    line-height:1!important;
    box-shadow:0 clamp(3px,.8vh,5px) 0 #050505!important;
  }

  body[class*="qwerty"] .pqQwertyReplayScore{
    order:3!important;
    position:relative!important;
    z-index:2!important;
    display:block!important;
    width:100%!important;
    min-height:0!important;
    margin:clamp(3px,.8vh,6px) auto 0!important;
    padding:0!important;
    text-align:center!important;
    white-space:nowrap!important;
    font-size:clamp(18px,4.4vh,26px)!important;
    line-height:1!important;
    font-weight:1000!important;
    transform:none!important;
  }
  body[class*="qwerty"] .pqQwertyReplayScore strong{font-size:inherit!important;line-height:inherit!important;}

  body[class*="qwerty"] .pqQwertyReplayClueCount{
    order:4!important;
    position:relative!important;
    z-index:2!important;
    display:block!important;
    min-height:0!important;
    margin:0 auto clamp(4px,.9vh,7px)!important;
    padding:0!important;
    text-align:center!important;
    white-space:nowrap!important;
    font-size:clamp(12px,3vh,17px)!important;
    line-height:1!important;
    font-weight:950!important;
    opacity:.72!important;
    transform:none!important;
  }

  /* This line caused visible collisions in landscape; CLUE key already explains the action. */
  body[class*="qwerty"] .pqQwertyReplayStatus{
    display:none!important;
    visibility:hidden!important;
    height:0!important;
    min-height:0!important;
    max-height:0!important;
    overflow:hidden!important;
    margin:0!important;
    padding:0!important;
  }

  body[class*="qwerty"] .pqQwertyReplayKeys{
    order:5!important;
    position:relative!important;
    z-index:2!important;
    width:calc(100vw - max(18px, env(safe-area-inset-left,0px)) - max(18px, env(safe-area-inset-right,0px)))!important;
    max-width:1180px!important;
    min-height:0!important;
    padding:0 4px calc(2px + env(safe-area-inset-bottom,0px))!important;
    margin:0 auto!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    display:grid!important;
    place-items:center!important;
    gap:0!important;
    transform:none!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }
  body[class*="qwerty"] .pqQwertyReplayKeyRow{
    width:100%!important;
    max-width:none!important;
    display:grid!important;
    grid-auto-flow:column!important;
    align-items:center!important;
    justify-content:stretch!important;
    gap:clamp(5px,.85vw,8px)!important;
    margin:0 auto clamp(5px,.95vh,8px)!important;
    box-sizing:border-box!important;
  }
  body[class*="qwerty"] .pqQwertyReplayKeyRow:nth-child(1){grid-template-columns:repeat(10,minmax(0,1fr))!important;}
  body[class*="qwerty"] .pqQwertyReplayKeyRow:nth-child(2){width:90%!important;grid-template-columns:repeat(9,minmax(0,1fr))!important;}
  body[class*="qwerty"] .pqQwertyReplayKeyRow--actionsIntegrated{width:100%!important;grid-template-columns:1.85fr repeat(8,minmax(0,1fr)) 1.85fr!important;}
  body[class*="qwerty"] .pqQwertyReplayKeyRow button,
  body[class*="qwerty"] .pqQwertyReplayKey,
  body[class*="qwerty"] .pqQwertyReplayActionKey{
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    height:clamp(34px,8.4vh,49px)!important;
    min-height:clamp(34px,8.4vh,49px)!important;
    padding:0 4px!important;
    border:2px solid #050505!important;
    border-radius:clamp(8px,1.8vh,13px)!important;
    background:#fff!important;
    color:#050505!important;
    font-size:clamp(13px,3.45vh,18px)!important;
    line-height:1!important;
    font-weight:1000!important;
    box-shadow:0 clamp(3px,.85vh,5px) 0 #050505!important;
    white-space:nowrap!important;
    box-sizing:border-box!important;
  }
  body[class*="qwerty"] .pqQwertyReplayActionKey{
    background:#91F88D!important;
    border-color:#050505!important;
    box-shadow:0 clamp(3px,.85vh,5px) 0 #238a36!important;
    font-size:clamp(12px,3.15vh,17px)!important;
    padding:0 8px!important;
  }

  body[class*="qwerty"] .pqQwertyReplayLogo{display:none!important;}
  body[class*="qwerty"] .pqQwertyReplayExit{
    position:fixed!important;
    top:calc(env(safe-area-inset-top,0px) + 8px)!important;
    right:calc(env(safe-area-inset-right,0px) + 10px)!important;
    z-index:20!important;
  }
}

@media (orientation: landscape) and (max-width: 980px) and (max-height: 430px){
  body[class*="qwerty"] .pqQwertyReplayGame,
  body.pq-qwerty-archive-playing .pqQwertyReplayGame{gap:2px!important;padding-top:calc(env(safe-area-inset-top,0px) + 3px)!important;}
  body[class*="qwerty"] .pqQwertyReplayBoard{grid-template-columns:minmax(104px,18vw) minmax(0,1fr)!important;gap:8px!important;}
  body[class*="qwerty"] .pqQwertyReplayClueRail,
  body[class*="qwerty"] .pqQwertyReplayClues{min-height:50px!important;max-height:70px!important;min-width:104px!important;}
  body[class*="qwerty"] .pqQwertyReplayTile{width:clamp(32px,5.5vw,48px)!important;height:clamp(32px,5.5vw,48px)!important;font-size:clamp(17px,3.25vw,27px)!important;}
  body[class*="qwerty"] .pqQwertyReplayScore{font-size:clamp(16px,4vh,22px)!important;margin-top:2px!important;}
  body[class*="qwerty"] .pqQwertyReplayClueCount{font-size:clamp(11px,2.6vh,15px)!important;margin-bottom:4px!important;}
  body[class*="qwerty"] .pqQwertyReplayKeyRow{gap:5px!important;margin-bottom:5px!important;}
  body[class*="qwerty"] .pqQwertyReplayKeyRow button,
  body[class*="qwerty"] .pqQwertyReplayKey,
  body[class*="qwerty"] .pqQwertyReplayActionKey{height:clamp(32px,8vh,44px)!important;min-height:clamp(32px,8vh,44px)!important;font-size:13px!important;border-radius:8px!important;}
  body[class*="qwerty"] .pqQwertyReplayActionKey{font-size:12px!important;}
}
