/* Confirmation is a readable status, including after its button becomes inert. */
body#top[data-page='play'] {
  --online-status-ink: #eeeaf8;
  --online-status-muted: #c1b9ce;
  --online-accepted-ink: #a5f3d6;
  --online-accepted-fill: #17332d;
  --online-accepted-edge: #64c7a7;
}

@media (orientation: landscape) and (max-width: 1100px) and (max-height: 350px) {
  /* The named acceptance message replaces the redundant readiness badge row
     on short screens, keeping the entire Core explanation visible. */
  body#top[data-page='play'].phone-match-active #core-modal #core-ready-container { display: none !important; }
  body#top[data-page='play'].phone-match-active #core-modal #core-modal-title { margin: 0 0 4px !important; }
  body#top[data-page='play'].phone-match-active #core-modal #core-modal-desc { line-height: 1.35 !important; }
  body#top[data-page='play'].phone-match-active #core-modal #core-action-container { gap: 4px !important; }
}
html[data-theme='light'] body#top[data-page='play'] {
  --online-status-ink: #30263f;
  --online-status-muted: #655a70;
  --online-accepted-ink: #15543d;
  --online-accepted-fill: #e0eee5;
  --online-accepted-edge: #719b85;
}
body#top[data-page='play'] .online-acceptance-status[hidden] { display: none !important; }
html[data-theme] body#top[data-page='play'] .online-acceptance-status {
  color: var(--online-status-ink) !important;
  font: 600 12px/1.4 Inter, sans-serif !important;
  letter-spacing: 0 !important;
  text-transform: none;
  text-shadow: none;
  opacity: 1 !important;
  text-align: center;
  min-height: 17px;
  max-width: 100%;
  text-wrap: balance;
}
html[data-theme] body#top[data-page='play'] .online-acceptance-status[data-acceptance-state='accepted'],
html[data-theme] body#top[data-page='play'] .online-acceptance-status[data-acceptance-state='complete'] { color: var(--online-accepted-ink) !important; }
html[data-theme] body#top[data-page='play'] :is(#action-bar, #core-modal, #gameover-modal) :is(#btn-combat-done, #btn-core-ok, #btn-new-game).online-outcome-button[data-acceptance-state='accepted'] {
  opacity: 1 !important;
  color: var(--online-accepted-ink) !important;
  -webkit-text-fill-color: var(--online-accepted-ink) !important;
  background: var(--online-accepted-fill) !important;
  border: 1px solid var(--online-accepted-edge) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
  justify-content: center;
  align-items: center;
  cursor: default;
}
body#top[data-page='play'] .online-outcome-button[data-acceptance-state='accepted']::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 10px;
  margin: -3px 9px 0 0;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  flex: 0 0 auto;
}
body#top[data-page='play'] #combat-accept-status { margin: 2px 0; }
body#top[data-page='play'] #action-bar[data-online-outcome-flow='true'] #btn-combat-done { min-width: 112px; }
body#top[data-page='play']:not(.phone-match-active) #action-bar[data-online-outcome-flow='true'] #btn-combat-done {
  top: calc(100% + 8px) !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  min-height: 44px;
  width: 144px;
  min-width: 144px;
  max-width: 144px;
  box-sizing: border-box;
  padding: 8px 18px !important;
}
html[data-theme] body#top[data-page='play'] :is(#combat-accept-countdown, #core-accept-countdown) { color: var(--online-status-muted) !important; }
body#top[data-page='play'] #online-turn-banner-container:has(#opponent-disconnect-banner[style*='flex']) {
  display: flex !important;
  height: auto !important;
  overflow: visible !important;
}

@media (orientation: landscape) and (max-width: 1100px) and (max-height: 599px) {
  /* Recovery takes the action and Rules docks. The transparent rail between
     them leaves the field clear and never changes its containing block. */
  body#top[data-page='play'].phone-match-active #online-turn-banner-container:has(#opponent-disconnect-banner[style*='flex']) {
    display: flex !important;
    left: var(--phone-dock-left) !important;
    right: var(--phone-dock-right) !important;
    bottom: var(--phone-action-bottom);
    height: var(--phone-action-height) !important;
  }
  body#top[data-page='play'].phone-match-active #opponent-disconnect-banner {
    position: relative;
    min-height: 100%;
    height: 100%;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    pointer-events: none !important;
  }
  body#top[data-page='play'].phone-match-active #opp-disc-text {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--phone-dock-width);
    padding: 5px 8px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    border: 1px solid var(--phone-line);
    border-radius: 9px;
    background: var(--phone-surface);
    color: var(--phone-ink);
    font: 600 11px/13px Inter, sans-serif !important;
  }
  body#top[data-page='play'].phone-match-active #btn-forfeit-exit {
    position: absolute;
    inset: 0 calc(var(--phone-menu-size) + var(--phone-footer-control-gap)) 0 auto;
    width: var(--phone-reference-width);
    height: var(--phone-action-height);
    min-height: var(--phone-action-height);
    padding: 6px !important;
    border-radius: 9px;
    border-color: var(--phone-line) !important;
    background: var(--phone-surface);
    color: var(--phone-ink);
    font-size: 11px !important;
  }
}
