/* The native match log is the phone game's one intentionally scrolling panel. */
@media (orientation: landscape) and (max-width: 1100px) and (max-height: 599px) {
  body#top[data-page='play'].phone-match-active #log-panel:not(.collapsed) {
    width: min(460px, calc(100vw - max(16px, env(safe-area-inset-left)) - max(16px, env(safe-area-inset-right)))) !important;
    height: min(280px, calc(100dvh - 72px - env(safe-area-inset-top) - env(safe-area-inset-bottom))) !important;
    max-height: calc(100dvh - 72px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    bottom: var(--phone-footer-inset, max(6px, env(safe-area-inset-bottom))) !important;
    overflow: hidden !important;
  }
  body#top[data-page='play'].phone-match-active #log-panel .log-toggle-btn {
    justify-content: space-between !important;
    padding-inline: 14px !important;
    min-height: 44px;
    flex-shrink: 0;
  }
  body#top[data-page='play'].phone-match-active #game-log {
    display: flex !important;
    flex: 1 1 0;
    min-height: 0;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    overflow-anchor: none;
    scroll-behavior: auto;
    padding: 12px;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--phone-line, #6d4f7b) transparent;
  }
  body#top[data-page='play'].phone-match-active #game-log .chat-msg {
    flex: 0 0 auto;
    max-width: 90%;
    font: 500 12px/1.45 Inter, sans-serif;
    padding: 8px 10px;
    overflow-wrap: anywhere;
  }
  html[data-phone-device='true'] body#top[data-page='play'].phone-match-active #game-log { scrollbar-width: thin; }
  html[data-phone-device='true'] body#top[data-page='play'].phone-match-active #game-log::-webkit-scrollbar { display: block; width: 5px; height: 0; }
  html[data-phone-device='true'] body#top[data-page='play'].phone-match-active #game-log::-webkit-scrollbar-track { background: transparent; }
  html[data-phone-device='true'] body#top[data-page='play'].phone-match-active #game-log::-webkit-scrollbar-thumb { border-radius: 3px; background: var(--phone-line, #6d4f7b); }
  body#top[data-page='play'].phone-match-active #game-log:focus-visible { outline: 2px solid var(--phone-muted, #b5a5c2); outline-offset: -3px; }
}
