#meimei-film-entry {
  box-sizing: border-box; position: fixed; inset: 0; margin: 0; width: 100%; max-width: none;
  height: 100%; height: 100dvh; max-height: none; padding: 0; border: 0;
  background: #15110f; color: #fff4db; font: 600 16px/1.3 system-ui,sans-serif;
}
#meimei-film-entry[open] {
  display: grid; grid-template-rows: auto minmax(0,1fr);
  padding-bottom: env(safe-area-inset-bottom); overflow: hidden;
}
#meimei-film-entry::backdrop { background: #15110f; }
#meimei-film-entry header {
  display: flex; gap: .5rem; align-items: center; justify-content: space-between; position: static;
  padding: max(5px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 5px max(12px,env(safe-area-inset-left));
  margin: 0; color: inherit; background: #211b17;
}
#meimei-film-entry header strong {
  font: inherit; min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
#meimei-film-entry header button { flex: none; white-space: nowrap; }
#meimei-film-entry header button:first-of-type { color: #fff0cf; background: #392a22; border-color: #bd9a72; }
#meimei-film-entry header button:disabled { opacity: .65; }
@media (max-width: 365px) {
  #meimei-film-entry header { gap: 4px; padding-inline: max(6px,env(safe-area-inset-right)); }
  #meimei-film-entry header button { padding-inline: 9px; }
  #meimei-film-entry header strong { font-size: 14px; }
}
#meimei-film-entry button, #meimei-film-replay {
  appearance: none; touch-action: manipulation; cursor: pointer; font: 650 14px/1.25 system-ui,sans-serif;
  width: auto; min-height: 44px; border-radius: 99px; padding: .5rem 1rem; letter-spacing: normal;
}
#meimei-film-entry button { color: #241709; background: #ffe7ad; border: 1px solid #fff1d5; }
#meimei-film-entry .mm-film-screen {
  min-height: 0; display: grid; place-items: center; background: #100e0d;
  background-repeat: no-repeat; background-size: contain; background-position: center;
  padding-inline: max(env(safe-area-inset-left),env(safe-area-inset-right));
}
#meimei-film-entry iframe { display: block; position: static; width: 100%; height: 100%; min-width: 200px; min-height: 200px; max-width: 1200px; margin: 0; border: 0; }
#meimei-film-entry .mm-film-screen video { display: block; width: 100%; height: 100%; object-fit: contain; }
#meimei-film-entry.mm-film-mission[open] { grid-template-columns: minmax(0,1fr); }
#meimei-film-entry.mm-film-mission .mm-film-screen {
  min-width: 0; container-type: size; grid-template: minmax(0,1fr) / minmax(0,1fr);
}
#meimei-film-entry.mm-film-mission .mm-film-screen > :is(video, iframe) {
  --film-height: min(100cqh, 177.777778cqw);
  display: block; box-sizing: border-box; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%;
  width: min(100cqw, 56.25cqh); height: var(--film-height); object-fit: contain;
  /* Keep the handoff centred on the viewport wherever its top matte already fits the header. */
  align-self: start; margin: 0; margin-block-start: max(0px, calc(100cqh - 50dvh - var(--film-height) / 2));
}
#meimei-film-replay {
  display: block; margin: .45rem auto; background: #392a22; color: #fff0cf; border: 1px solid #bd9a72;
}
#meimei-film-entry button:focus-visible, #meimei-film-replay:focus-visible { outline: 3px solid #fcaf69; outline-offset: 2px; }

#meimei-film-entry [hidden] { display: none !important; }

#meimei-story-mission {
  display: table; margin: .45rem auto; padding: .55rem .8rem; min-height: 40px;
  color: #54351f; background: #ffedc7; border-radius: 10px; border: 1px solid #b9956b;
  font: 650 14px/1.45 system-ui,sans-serif; text-decoration: none;
}
#meimei-story-mission:focus-visible { outline: 3px solid #c45a20; outline-offset: 2px; }
