/* Small optional display controls share the game's paper and rounded buttons. */
.mobile-fullscreen-button {
  position: fixed; right: max(8px, env(safe-area-inset-right)); bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 18; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  color: var(--ink, #334a60); background: #fff9e8f5; border: 2px solid #d8c9a3;
  border-radius: 50%; box-shadow: 0 3px 0 #d8c6a3; cursor: pointer; touch-action: manipulation;
}
.mobile-fullscreen-button[hidden], .mobile-fullscreen-menu[hidden], .mobile-display-status[hidden], .mobile-install-guide [hidden] { display: none !important; }
.mobile-fullscreen-button:active { transform: translateY(2px); box-shadow: 0 1px 0 #d8c6a3; }
.mobile-fullscreen-button:focus-visible, .mobile-install-guide button:focus-visible, .mobile-install-guide video:focus-visible { outline: 3px solid #287ca3; outline-offset: 3px; }
.mobile-display-status {
  position: fixed; z-index: 150; left: 50%; bottom: max(62px, calc(env(safe-area-inset-bottom) + 62px));
  transform: translateX(-50%); max-width: min(480px, calc(100vw - 32px)); width: max-content;
  margin: 0; padding: 12px 16px; border: 2px solid #d8c9a3; border-radius: 18px;
  background: #fff9e8; color: var(--ink, #334a60); box-shadow: 0 4px 16px #5a463225; font-size: 14px; line-height: 1.6;
}
.mobile-install-guide {
  width: min(760px, calc(100vw - 24px)); max-width: none;
  max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  padding: 20px; border: 2px solid #d8c9a3; border-radius: 24px; margin: auto;
  background: #fff9e8; color: var(--ink, #334a60); font-family: var(--round, system-ui, sans-serif);
  box-shadow: 0 8px 32px #5a463230; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  touch-action: pan-y; user-select: text; -webkit-user-select: text; text-align: start;
}
.mobile-install-guide::backdrop { background: #4a3b294f; }
.mobile-install-header { display: flex; align-items: flex-start; gap: 10px; }
.mobile-install-header h2 { flex: 1; margin: 0; font-size: clamp(20px, 4.8vw, 25px); line-height: 1.5; }
.mobile-install-close { flex: none; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid #d8c9a3; background: #fffdf5; color: inherit; font: inherit; font-size: 27px; line-height: 1; cursor: pointer; }
.mobile-install-intro { margin: 10px 0 16px; font-size: 14px; line-height: 1.7; }
.mobile-install-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.mobile-install-tabs button { flex: 1; padding: 10px 8px; min-height: 44px; border: 2px solid #d8c9a3; border-radius: 99px; background: #fffdf5; color: inherit; font: inherit; cursor: pointer; }
.mobile-install-tabs button[aria-pressed="true"] { background: #f7cd46; border-color: #d9a92e; }
.mobile-install-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.mobile-install-guide section { min-width: 0; }
.mobile-install-guide h3 { margin: 0 0 9px; font-size: 16px; line-height: 1.5; }
.mobile-install-media video { display: block; width: 100%; aspect-ratio: 9 / 10; max-height: 330px; background: #eee5ce; border: 1px solid #d8c9a3; border-radius: 16px; object-fit: contain; }
.mobile-install-small { margin: 9px 0; font-size: 12px; line-height: 1.7; }
.mobile-install-steps ol { margin: 0; padding-inline-start: 24px; font-size: 14px; line-height: 1.7; }
.mobile-install-steps li { padding-inline-start: 3px; margin-bottom: 10px; }
.mobile-install-steps li::marker { font-weight: 800; color: #8a6720; }
.mobile-install-after { padding: 12px; margin: 12px 0; border-radius: 12px; background: #f1edcf; font-size: 13px; line-height: 1.7; }
.mobile-install-actions {
  position: sticky; bottom: -20px; z-index: 1; display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  margin-top: 18px; padding: 12px 0 20px; background: #fff9e8; border-top: 1px solid #d8c9a3;
  box-shadow: 0 -8px 10px #fff9e8e8;
}
.mobile-install-primary, .mobile-install-secondary { border: 2px solid #d8c9a3; border-radius: 99px; min-height: 48px; padding: 11px 16px; color: inherit; font: inherit; font-size: 14px; line-height: 1.5; cursor: pointer; touch-action: manipulation; }
.mobile-install-primary { background: #f7cd46; box-shadow: 0 3px 0 #d9a92e; font-weight: 800; }
.mobile-install-secondary { background: #fffdf5; }
.mobile-install-error { color: #a43b31; }
@media (max-width: 540px) {
  .mobile-install-guide { padding: 16px; border-radius: 20px; }
  .mobile-install-content { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .mobile-install-media video { max-height: none; }
  .mobile-install-actions { bottom: -16px; padding-bottom: 16px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .mobile-install-guide { width: min(800px, calc(100vw - 20px)); padding: 14px 18px; }
  .mobile-install-header h2 { font-size: 20px; }
  .mobile-install-media video { max-height: 280px; }
  .mobile-install-actions { flex-direction: row; bottom: -14px; padding-bottom: 14px; }
  .mobile-install-actions > button { flex: 1; }
}
