.match3-goals [data-match3-goal].is-priority {
  border-color: #f5b66366 !important;
  background: linear-gradient(135deg, #f59e0b15, #ffffff05) !important;
  box-shadow: inset 3px 0 #f5b663, 0 0 18px #f59e0b16;
}

.app-game-shell .game-pause-orb {
  right: max(58px, calc(env(safe-area-inset-right) + 58px));
}

.m3j-game .game-pause-orb,
.match3-classic-game .game-pause-orb {
  right: max(104px, calc(env(safe-area-inset-right) + 104px));
}

.game-pause-orb.is-docked {
  position: relative;
  z-index: 2;
  inset: auto;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  min-height: 34px;
  margin: 0;
  padding: 0;
  border-radius: 11px;
}

.game-pause-orb > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 16px;
  height: 16px;
  font-size: 0;
}

.game-pause-orb > span::before,
.game-pause-orb > span::after {
  content: "";
  display: block;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 0 6px rgba(167, 139, 250, .32);
}

.game-pause-orb > .game-pause-label {
  display: none;
}

.game-abandon-form:has(.game-pause-orb) {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: stretch;
  gap: 6px;
}

.m3j-play-nav [data-match3-abandon]:has(.game-pause-orb) {
  display: grid;
  grid-template-columns: 34px minmax(0, auto);
  align-items: stretch;
  gap: 6px;
  margin: 0;
}

.m3j-play-nav [data-match3-abandon] > .game-pause-orb,
.m3j-play-nav [data-match3-abandon] > .m3j-abandon-button {
  height: 34px;
  min-height: 34px;
  margin: 0 !important;
}

.game-abandon-form[hidden] { display: none !important; }
.tetris-abandon-short { display: none; }

.game-abandon-form:has(.game-pause-orb) > .game-pause-orb,
.game-abandon-form:has(.game-pause-orb) > button[type="submit"],
.game-abandon-form:has(.game-pause-orb) > button:not([type]) {
  margin: 0 !important;
}

.m3j-play-nav > .game-pause-orb.is-docked,
.m3c-play-nav > .game-pause-orb.is-docked {
  margin-left: auto;
}

.ux-paused .gameplay-touch-zone,
.ux-paused .match3-board {
  pointer-events: none;
}

/* First-level onboarding blocks play until the player acknowledges it. */
.game-coach {
  position: fixed;
  z-index: 10020;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: radial-gradient(circle at 50% 42%, #7459dc2b, transparent 42%), #02050dcc;
  backdrop-filter: blur(13px) saturate(.82);
  pointer-events: auto;
}

.game-coach > div {
  width: min(390px, 100%);
  padding: 18px;
  border-radius: 24px;
  background: radial-gradient(circle at 12% 0, #8d70ff24, transparent 38%), linear-gradient(145deg, #211d3bf7, #090f20fa);
  box-shadow: 0 30px 90px #000d, inset 0 1px #fff2;
}

.game-coach footer { justify-content: stretch; }
.game-coach footer button { width: 100%; min-height: 40px; }

@media (max-width: 700px) and (orientation: landscape) {
  .game-urgency { display: none !important; }
  .game-pause-card { max-height: calc(100dvh - 16px); }
  .game-pause-card nav { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  body.app-game-shell .game-shell-controls .game-shell-action-form:has(.game-pause-orb) {
    display: flex !important;
    flex: 0 0 145px !important;
    width: 145px !important;
    max-width: 145px !important;
    align-items: center !important;
    gap: 5px !important;
    margin: 0 !important;
  }

  body.app-game-shell .game-shell-controls .game-shell-action-form > .game-pause-orb.is-docked,
  body.app-game-shell .game-shell-controls .game-shell-action-form > button:not(.game-pause-orb) {
    display: inline-flex !important;
    flex: 0 0 70px !important;
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    height: 30px !important;
    min-height: 30px !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    margin: 0 !important;
    padding: 0 7px !important;
    border-radius: 9px !important;
    font-size: 9px !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
  }

  body.app-game-shell .game-shell-controls .game-shell-action-form > .game-pause-orb.is-docked > .game-pause-label {
    display: inline !important;
    color: inherit !important;
    font: inherit !important;
  }

  html.ux-large-text body.app-game-shell .game-shell-controls .game-shell-action-form > .game-pause-orb.is-docked,
  html.ux-large-text body.app-game-shell .game-shell-controls .game-shell-action-form > button:not(.game-pause-orb) {
    font-size: 10px !important;
  }

  body.gameplay-page .game .game-abandon-form:has(.game-pause-orb) {
    display: flex !important;
    flex-flow: row nowrap !important;
    justify-content: center;
    align-self: center;
    width: 80px !important;
    max-width: 80px !important;
    margin: 3px auto 0 !important;
    gap: 5px;
  }

  body.gameplay-page .game .game-abandon-form > .game-pause-orb.is-docked {
    position: relative !important;
    inset: auto !important;
    display: inline-grid !important;
    flex: 0 0 27px !important;
    place-items: center !important;
    box-sizing: border-box;
    width: 27px !important;
    min-width: 27px !important;
    max-width: 27px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    border-radius: 9px !important;
  }

  body.gameplay-page .game .game-abandon-form > button[type="submit"],
  body.gameplay-page .game .game-abandon-form > button:not([type]) {
    position: relative !important;
    inset: auto !important;
    display: inline-flex !important;
    flex: 0 0 48px !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 28px !important;
    min-height: 28px !important;
    margin: 0 !important;
    gap: 2px;
    padding: 0 2px !important;
    border-radius: 9px !important;
    overflow: hidden;
    color: #fbd7df !important;
    font-size: 7px !important;
    font-weight: 850 !important;
    line-height: 1 !important;
    white-space: nowrap;
  }

  body.gameplay-page .game .game-abandon-form > button[type="submit"]::before,
  body.gameplay-page .game .game-abandon-form > button:not([type])::before {
    content: "×" !important;
    display: inline-grid !important;
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    margin: 0 !important;
    place-items: center;
    border: 1px solid rgba(251, 215, 223, .3);
    border-radius: 50%;
    color: #ffe5eb;
    font-size: 8px;
    line-height: 1;
  }

  .tetris-abandon-long { display: none; }
  .tetris-abandon-short { display: inline; }
}

/* Keep the Journey heading and both mobile session actions visually balanced,
   including when the player enables larger interface text. */
.game[data-game-mode="JOURNEY"] .journey-star-progress > strong {
  width: 100%;
  justify-self: stretch !important;
  text-align: center !important;
}

@media (max-width: 700px) {
  body.gameplay-page .game .game-abandon-form:has(.game-pause-orb) {
    width: 145px !important;
    max-width: 145px !important;
    gap: 5px !important;
  }

  body.gameplay-page .game .game-abandon-form > .game-pause-orb.is-docked,
  body.gameplay-page .game .game-abandon-form > button[type="submit"],
  body.gameplay-page .game .game-abandon-form > button:not([type]) {
    display: inline-flex !important;
    flex: 0 0 70px !important;
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    height: 30px !important;
    min-height: 30px !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 0 7px !important;
    font-size: 9px !important;
    line-height: 1 !important;
  }

  body.gameplay-page .game .game-abandon-form > .game-pause-orb.is-docked > .game-pause-label {
    display: inline !important;
    color: inherit !important;
    font: inherit !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
  }

  body.gameplay-page .game .game-abandon-form > .game-pause-orb.is-docked > span {
    flex: 0 0 12px !important;
    width: 12px !important;
    height: 12px !important;
    gap: 2px !important;
  }

  body.gameplay-page .game .game-abandon-form > .game-pause-orb.is-docked > span::before,
  body.gameplay-page .game .game-abandon-form > .game-pause-orb.is-docked > span::after {
    width: 2px !important;
    height: 11px !important;
  }

  html.ux-large-text body.gameplay-page .game .game-abandon-form > .game-pause-orb.is-docked,
  html.ux-large-text body.gameplay-page .game .game-abandon-form > button[type="submit"],
  html.ux-large-text body.gameplay-page .game .game-abandon-form > button:not([type]) {
    font-size: 10px !important;
  }
}
