/* Tutorial styles are isolated from the editor's wall and rendering controls. */
.tutorial-open {
  min-height: 46px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #1c5c42;
  border-radius: 9px;
  background: transparent;
  color: #1c5c42;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}
.tutorial-open-home { width: 100%; margin-top: 14px; }
.tutorial-open-menu { width: 100%; margin: 0 0 20px; justify-content: flex-start; }
.tutorial-open svg { width: 23px; height: 23px; flex: 0 0 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.tutorial-open:hover { background: #edf4ef; border-color: #144c35; color: #144c35; }
.tutorial-open:focus-visible, .tutorial-close:focus-visible, .tutorial-retry:focus-visible, .tutorial-video:focus-visible { outline: 3px solid #168562; outline-offset: 3px; }
.tutorial-dialog {
  /* The tutorial is portrait: size the player by available height, not a wide
     landscape canvas. The minimum keeps its header usable on short screens. */
  width: clamp(320px, calc(56.25vh - 122px), 520px);
  width: clamp(320px, calc(56.25dvh - 122px), 520px);
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #d7dfd9;
  border-radius: 16px;
  background: #fafbf8;
  color: #18251f;
  box-shadow: 0 24px 80px #13251b4d;
}
.tutorial-dialog::backdrop { background: #11221acc; }
.tutorial-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; }
.tutorial-header > div { min-width: 0; }
.tutorial-header h2 { margin: 0; font-size: clamp(18px, 2.4vw, 24px); line-height: 1.25; }
.tutorial-header p { margin: 7px 0 0; font-size: 13px; line-height: 1.45; color: #526159; }
.tutorial-close { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; padding: 10px; border: 1px solid #dce4de; border-radius: 50%; background: #fff; color: #24392d; }
.tutorial-close:hover { background: #edf4ef; }
.tutorial-close svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.tutorial-stage { min-height: 160px; background: #14231c; color: #fff; }
.tutorial-video { display: block; width: 100%; max-height: calc(100vh - 220px); max-height: calc(100dvh - 220px); aspect-ratio: 9 / 16; object-fit: contain; background: #0b130f; }
.tutorial-status, .tutorial-error { margin: 0; padding: 48px 24px; text-align: center; font-size: 15px; line-height: 1.5; }
.tutorial-error p { margin: 0 0 18px; }
.tutorial-retry { min-height: 44px; padding: 10px 24px; border: 1px solid #c6e5d3; border-radius: 8px; background: #f6fcf8; color: #174d36; font-weight: 600; }
.tutorial-retry:hover { background: #dcefe3; }
.tutorial-play-hint { margin: 0; padding: 13px 22px; color: #526159; font-size: 13px; line-height: 1.4; }
.tutorial-dialog [hidden] { display: none; }
@media (max-width: 600px) {
  .tutorial-dialog { max-width: calc(100vw - 20px); max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); border-radius: 12px; }
  .tutorial-header { padding: 16px; gap: 10px; }
  .tutorial-header p { font-size: 12px; }
  .tutorial-open-home { min-height: 46px; font-size: 14px; }
  .tutorial-play-hint { padding: 12px 16px; }
}
@media (max-height: 450px) {
  .tutorial-header { padding-top: 10px; padding-bottom: 10px; }
  .tutorial-header p { display: none; }
  .tutorial-stage { min-height: 100px; }
  .tutorial-video { max-height: calc(100vh - 145px); max-height: calc(100dvh - 145px); }
  .tutorial-status, .tutorial-error { padding-top: 20px; padding-bottom: 20px; }
}
